Skip to content

Instantly share code, notes, and snippets.

View yansyaf's full-sized avatar

Yan Syafri Hidayat yansyaf

View GitHub Profile
@yansyaf
yansyaf / gist:8156010
Created December 28, 2013 04:03
GMP example
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
int main(void)
{
mpz_t x;
mpz_t y;
mpz_t result;
#include "mex.h"
/* Input Arguments */
#define X1 prhs[0]
#define X2 prhs[1]
/* Output Arguments */
#define Y plhs[0]
void mexAdder( int nlhs, mxArray *plhs[],
#include "mex.h"
#include <string.h>
void mexAdder( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] );
void mexMult( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] );
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[] )
{
char *functionName;
#include "mex.h"
/* Input Arguments */
#define X1 prhs[0]
#define X2 prhs[1]
/* Output Arguments */
#define Y plhs[0]
void mexFunction( int nlhs, mxArray *plhs[],