#mlpack on Windows
mlpack, while not designed with Windows as a specific target, can still be built and run on Windows with some configuration. This document details the steps necessary to get MLPACK compiled using MinGW64.
#Prerequisites
require('tcltk') | |
calcinp ='' | |
mkput = function(sym){ | |
function(...){ | |
calcinp <<- paste(calcinp,sym,sep='') | |
tkconfigure(display,text=calcinp) | |
} | |
} | |
clearit = function(...){ |
# required: RGtk2 | |
calculateGUI <- function() { | |
## Run on "OK" | |
performStatistics <- function(button, user.data) { | |
res <- NULL | |
d <- NULL | |
error <- NULL | |
warning <- NULL | |
# Get the information about data and the file | |
the.file <- filename$getText() |
# improved list of objects by Dirk | |
.ls.objects <- function (pos = 1, pattern, order.by, | |
decreasing=FALSE, head=FALSE, n=5) { | |
napply <- function(names, fn) sapply(names, function(x) | |
fn(get(x, pos = pos))) | |
names <- ls(pos = pos, pattern = pattern) | |
obj.class <- napply(names, function(x) as.character(class(x))[1]) | |
obj.mode <- napply(names, mode) | |
obj.type <- ifelse(is.na(obj.class), obj.mode, obj.class) | |
obj.size <- napply(names, object.size) |
// | |
// Based on code sent by Kevin Ushey | |
// to Rcpp-devel on Tue, 8 Jul 2014 | |
// | |
#ifndef LIST_BUILDER_H | |
#define LIST_BUILDER_H | |
#include <Rcpp.h> | |
using namespace Rcpp; |
#include <iostream> | |
#include <fstream> | |
#include <unistd.h> | |
void process_mem_usage(double& vm_usage, double& resident_set) | |
{ | |
vm_usage = 0.0; | |
resident_set = 0.0; | |
// the two fields we want |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
vector<vector<int> > cart_product (const vector<vector<int>>& v) { | |
vector<vector<int>> s = {{}}; | |
for (auto& u : v) { | |
vector<vector<int>> r; |
require(reshape2) | |
require(rgl) | |
plot_rgl_model <- function(fdata){ | |
fdata <- fdata[order(fdata[, 1], fdata[, 2]), ] | |
orig_names <- colnames(fdata) | |
colnames(fdata) <- c("x", "y", "z") | |
fdata <- as.data.frame(fdata) |
// callback4.cpp - C++11 Lambda Callback | |
// To build: | |
// g++ -std=c++11 callback4.cpp | |
// Situation: A "Caller" class allows another class "Callee" | |
// to connect to it via callback. How to implement this? | |
// A C++11 lambda function can be used. |
#mlpack on Windows
mlpack, while not designed with Windows as a specific target, can still be built and run on Windows with some configuration. This document details the steps necessary to get MLPACK compiled using MinGW64.
#Prerequisites
set backspace=indent,eol,start | |
colorscheme default | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |