NMath Code Examples

All classes reside in the CenterSpace.NMath.Core namespace


Code Samples Zip File
Vector ExamplesDescriptionSource
VectorExample Example showing some of the basic functionality of the vector classes. C#  VB  F#
VectorArithmeticExample Example showing the element-wise operators overloaded for vector/vector and vector/scalar operations. C#  VB  
VectorRangeExample Example showing how to use the indexing class Range with the vector classes. C#  VB  
VectorSliceExample Example showing how to use the indexing class Slice with the vector classes. C#  VB  


Matrix ExamplesDescriptionSource
MatrixExample Example showing some of the basic functionality of the matrix classes. C#  VB  
MatrixArithmeticExample Example showing the element-wise operators overloaded for matrix/matrix and matrix/scalar operations. C#  VB  
MatrixRangeExample Example showing how to use the indexing class Range with the matrix classes. C#  VB  
MatrixSliceExample Example showing how to use the indexing class Slice with the matrix classes. C#  VB  


Functions of Vectors and MatricesDescriptionSource
NMathFunctionsExample Example showing some of the functionality of the NMathFunctions class. C#  VB  
ApplyTransformExample Example showing how to use the matrix and vector Apply() and Tranform() methods. C#  VB  


Factorization ExamplesDescriptionSource
LUFactorizationExample Example showing how to use the LU factorization classes to solve linear systems, and to compute matrix inverses, condition numbers, and determinants. C#  VB  


Least Squares ExamplesDescriptionSource
LeastSquaresExample Example showing how to use the least squares classes to solve linear least squares problems. C#  VB  


Random Number ExamplesDescriptionSource
RandomNumberExample Example showing how to generate random number from a normal distribution, using the class RandGenNormal, and place them in a Histogram. C#  VB  
AdvancedRNGExample Example showing how to create a random number generator for a particular probability distribution using a specified uniform deviate method. C#  VB  
MonteCarloRNGExample Example showing how to calculate an approximation for Pi using a Monte Carlo method and the uniform random number generator class RandGenUniform. C#  VB  
VectorizedRNGExample Example showing how to generate random numbers from a stream. C#  VB  
QuasiRandomExample Example showing how to generate a sequence of quasirandom points. C#  VB  
IndependentStreamsExample Example showing how to create streams of independent random numbers. C#  VB  


FFT, Convolution, and Correlation ExamplesDescriptionSource
FFTExample Examples showing how to use the basic FFT classes. C#  VB  
FFT1DExample Example showing how to use the 1D FFT classes. C#  VB  
FFT2DExample Example showing how to use the 2D FFT classes. C#  VB  
ConvolutionExample Example showing how to use the convolution classes. C#  VB  
CorrelationExample Example showing how to use the correlation classes. C#  VB  F#


Wavelet TransformsDescriptionSource
DWT Example Example showing Discrete Wavelet Transform (DWT). C#  VB  
SWT Example Example showing Stationary Wavelet Transform (SWT). C#  VB  


Signal Processing ExamplesDescriptionSource
MovingWindowFilterExample Example showing how to filter data using a moving average filter. C#  VB  
SavitzkyGolayFilteringExample Example showing how to use the Savitzky-Golay filtering class. C#  VB  


Calculus ExamplesDescriptionSource
OneVariableFunctionExample Example showing how to create and manipulate functions of one variable. C#  VB  
PolynomialExample Example showing how to create and manipulate Polynomial objects. C#  VB  
DifferentiationExample Example showing how to create differentiator objects for greater control over how numerical differentiation is performed. C#  VB  
IntegrationExample Example showing how to create integrator objects for greater control over how numerical integration is performed. C#  VB  


Misc. ExamplesDescriptionSource
CurrencyExample Example showing how to read and write vectors of currencies. C#  VB  
MissingValuesExample Example showing how to perform statistical operations on matrices containing missing data. C#  VB  
DatabaseExample Example showing how to use ADO.NET data structures with matrices. C#  VB  
BinarySerializationExample Example showing how to serialize and deserialize an NMath Core object in binary format. C#  VB  
SoapSerializationExample Example showing how to serialize and deserialize an NMath Core object in SOAP format. C#  VB  


Structured Sparse Matrix ExamplesDescriptionSource
TriangularMatrixExample Example demonstrating the features of the triangular matrix classes. C#  VB  
SymmetricMatrixExample Example demonstrating the features of the symmetric matrix classes. C#  VB  
HermitianMatrixExample Example demonstrating the features of the Hermitian matrix classes. C#  VB  
BandMatrixExample Example demonstrating the features of the banded matrix classes. C#  VB  
HermitianBandMatrixExample Example demonstrating the features of the banded Hermitian matrix classes. C#  VB  
SymmetricBandMatrixExample Example demonstrating the features of the banded symmetric matrix classes. C#  VB  
TridiagonalMatrixExample Example demonstrating the features of the tridiagonal matrix classes. C#  VB  


Structured Sparse Matrix Factorization ExamplesDescriptionSource
SymFactExample Example demonstrating the features of the factorization classes for symmetric matrices. C#  VB  
BandFactExample Example demonstrating the features of the factorization classes for banded matrices. C#  VB  
TriDiagFactExample Example demonstrating the features of the factorization classes for tridiagonal matrices. C#  VB  
HermPDTriDiagFactExample Example demonstrating the features of the factorization classes for Hermitian positive definite tridiagonal matrices. C#  VB  


General Sparse Vector and Matrix ExamplesDescriptionSource
SparseVectorExample Example demonstrating the features of the general sparse vector classes. C#  VB  
SparseMatrixExample Example demonstrating the features of the general sparse matrix classes. C#  VB  
SparseFactorizationExample Example showing how to solve a symmetric sparse linear system. C#  VB  


Decomposition ExamplesDescriptionSource
QRDecompExample Example demonstrating the features of the QR decomposition classes. C#  VB  
SVDecompExample Example demonstrating the features of the singular value decomposition classes. C#  VB  
EigDecompExample Example demonstrating the features of the eigenvalue decomposition classes. C#  VB  F#


Least Squares ExamplesDescriptionSource
LeastSquaresExample Example demonstrating the features of the classes for solving orindary least squares problems. C#  VB  
WeightedLeastSquaresExample Example demonstrating the features of the classes for solving weighted least squares problems. C#  VB  
IterativelyReweightedLeastSqExample Example demonstrating the features of the classes for solving iteratively reweighted least squares problems. C#  VB  


Linear Programming ExamplesDescriptionSource
LinearProgrammingExample Example showing how to solve a linear programming (LP) problem. C#  VB  F#
PrimalDualSimplexExample Example showing how to solve the Klee Minty cube linear programming problem using both primal and dual simplex methods. C#  VB  
MixedIntLinearProgrammingExample Example showing how to solve a linear programming (LP) problem where one of the variables is constrained to have an integer value. C#  VB  
BinaryLinearProgrammingExample Example showing how to solve a linear programming (LP) problem where all the variables are binary. C#  VB  


Minimization ExamplesDescriptionSource
OneVariableMinimizationExample Example showing how to find a minimum of a univariate function. C#  VB  
MultiVariableMinimizationExample Example showing how to find a minimum of a multivariate function. C#  VB  
TrustRegionMinimizationExample Example showing how to minimize a function using the Trust Region method. C#  VB  


Simulated Annealing ExamplesDescriptionSource
SimulatedAnnealingExample Example showing how to find the minimum of a function using simulated annealing. C#  VB  


Nonlinear Programming ExamplesDescriptionSource
NonlinearProgrammingExample Example showing how to solve a NonLinear Programming (NLP) problem. C#  VB  
SimpleNonlinearProgrammingExample Example showing how to solve a NonLinear Programming (NLP) problem with linear constraints and variable bounds. C#  VB  
QuadraticProgrammingExample Example showing how to solve a Quadratic Programming (QP) problem. C#  VB  
InteriorPointQPExample Example showing how to use the interior point quadratic programming solver to solve a quadratic programming problem. C#  VB  
StochasticHillClimbingExample Example showing how to use the stochastic hill climbing solver to solve a nonlinear programming problem. C#  VB  
ConstrainedLeastSquaresExample Example showing how to solve the constrained least squares problem. C#  VB  
BinaryNonlinearProgrammingExample Example showing how to solve a nonlinear programming problem that has some binary and integral constraints on its solution variables. C#  VB  


Curve Fitting ExamplesDescriptionSource
PolynomialLeastSquaresExample Example showing how to fit a polynomial through a set of points. C#  VB  
OneVariableCurveFittingExample Example showing how to fit a generalized one variable function to a set of points. C#  VB  
MultiVariableCurveFittingExample Example showing how to fit a generalized multivariable function to a set of points. C#  VB  F#


Differential Equation ExamplesDescriptionSource
RungeKuttaSolverExample Example showing how to solve first order initial value differential equations. C#  VB  


Misc ExamplesDescriptionSource
RootFindingExample Example showing how to find a root of a univariate function. C#  VB  
TwoVariableIntegrationExample Example showing how to integrate over two variables. C#  VB  

Analysis of Variance ExamplesDescriptionSource
OneWayAnovaExample Example showing how use class OneWayAnova to perform a simple one-way ANOVA. C#  VB  
AdvancedOneWayAnovaExample Example showing some of the advanced features of class OneWayAnova. C#  VB  
OneWayRanovaExample Example showing how to use class OneWayRanova to perform a simple one-way ANOVA with repeated measures. C#  VB  
AdvancedOneWayRanovaExample Example showing some of the advanced features of class OneWayRanova. C#  VB  
TwoWayAnovaExample Example showing how to use class TwoWayAnova to perform a simple two-way ANOVA. C#  VB  
AdvancedTwoWayAnovaExample Example showing some of the advanced features of class TwoWayAnova. C#  VB  
TwoWayRanovaExample Example showing how to use class TwoWayRanova to perform a two-way ANOVA with repeated measures on one factor. C#  VB  
TwoWayRanovaTwoExample Example showing how to use class TwoWayRanovaTwo to perform a two-way ANOVA with repeated measures on both factors. C#  VB  


Clustering ExamplesDescriptionSource
ClusterExample Example showing how to perform an hierarchical cluster analysis. C#  VB  
KMeansClusteringExample Example showing how to perform a k-means cluster analysis on a data set. C#  VB  
NMFClusteringExample Example demonstrating how to cluster data using NMF. C#  VB  


Data Frame ExamplesDescriptionSource
DataFrameExample Example showing how to manipulate data using the DataFrame class. C#  VB  
CrossTabulationExample Example showing how to use the cross-tabulation functionality on a DataFrame. C#  VB  
MissingValuesExample Example showing how to manipulate data that has missing values. C#  VB  


Distribution ExamplesDescriptionSource
ProbabilityDistributionExample Example showing how to use the probability distribution classes. C#  VB  


Factor Analysis ExamplesDescriptionSource
FACorrelationExample Example showing how to perform a factor analysis. C#  VB  
FAAdvancedExample Example showing advanced features of factor analysis. C#  VB  


Hypothesis Testing ExamplesDescriptionSource
HypothesisTestExample Example showing how to use the hypothesis test classes to test statistical hypotheses. C#  VB  


Nonnegative Matrix Factorization (NMF) ExamplesDescriptionSource
NMFExample Example showing basic NMF. C#  VB  
NMFOrderedConnectivityMatrixExample Example showing how to create an ordered connectivity matrix to display the results of NMF clustering. C#  VB  
NMFConsensusMatrixExample Example showing how to compute a consensus matrix averaging different NMF clusterings. C#  VB  


Misc ExamplesDescriptionSource
StatsFunctionsExample Example showing how to use the descriptive statistics functions of the StatsFunctions class. C#  VB  
BoxCoxExample Example showing how to compute the Box-Cox power tranformations. C#  VB  
SubsetExample Example showing how to access arbitrary subsets of a data frame. C#  VB  
FactorExample Example showing how to create and manipulate factors. C#  VB  
ApplyTransformExample Example showing how to use the apply and transform functionality on a DataFrame. C#  VB  
ADOExample Example showing how to display a DataFrame in an ADO.NET DataGrid. C#  VB  


Partial Least Squares ExamplesDescriptionSource
PLSExample Example showing basics of PLS1 and PLS2. C#  VB  
PLS1ScoresAndLoadingsExample Example showings scores and loadings with PLS1. C#  VB  
PLS2CrossValidationExample Example showing cross-validation using PLS2. C#  VB  
PLS2ScoresAndLoadingsExample Example showings scores and loadings with PLS2. C#  VB  


Principal Component Analysis ExamplesDescriptionSource
PrincipalComponentExample Example showing how to perform a principal component analysis. C#  VB  F#


Regression ExamplesDescriptionSource
SimpleLinearRegressionExample Example showing how to use the linear regression class to perform a simple linear regression. C#  VB  
MultipleLinearRegressionExample Example showing how to perform multiple linear regression. C#  VB  
LogisticRegressionExample Example showing how to perform logistic regression. C#  VB  
Top