A technical computing tool
A technical computing tool.
The library was inspired by Octave. Catool is a computing toolbox written in c++.
Catool provide an easy-used technical computing c++ environment.
Cuda or opencl acceleration will be added in latter versions.
These compilers which have been tested are shown in the following list.
This simple example is ‘hello world’.
#include"MainToolbox\Types.h"
int main()
{
catool::main_toolbox::disp("hello world!");
return 0;
}
#include"MainToolbox\Types.h"
#include"MainToolbox\Array.h"
int main()
{
catool::main_toolbox::Array<int> intArry=ones<int>(100);
catool::main_toolbox::disp(intArray);
return 0;
}
zeros
Create array of all zerosones
Create array of all onesrand
Uniformly distributed random numberstrue
Logical 1 (true)false
Logical 0 (false)eye
Identity matrixdiag
Create diagonal matrix or get diagonal elements of matrixblkdiag
Construct block diagonal matrix from input argumentscat
Concatenate arrays along specified dimensionhorzcat
Concatenate arrays horizontallyvertcat
Concatenate arrays vertically
linspace
Generate linearly spaced vectorlogspace
Generate logarithmically spaced vectormeshgrid
2-D and 3-D grids
length
Length of largest array dimensionsize
Array sizendims
Number of array dimensionsnumel
Number of array elementsisscalar
Determine whether input is scalarisvector
Determine whether input is vectorismatrix
Determine whether input is matrixisrow
Determine whether input is row vectoriscolumn
Determine whether input is column vectorisempty
Determine whether array is empty
sort
Sort array elementsflip
Flip order of elementsfliplr
Flip array left to rightflipud
Flip array up to downrot90
Rotate array 90 degreestranspose
Transpose vector or matrixctranspose
Complex conjugate transposereshape
Reshape arraysqueeze
Remove singleton dimensions
plus
Additionuplus
Unary plusminus
Subtractionuminus
Unary minustimes
Element-wise multiplicationrdivide
Right array divisionldivide
Left array divisionpower
Element-wise powermtimes
Matrix Multiplication
cumprod
Cumulative productcumsum
Cumulative sumdiff
Differences and Approximate Derivativesmovsum
Moving sumprod
Product of array elementssum
Sum of array elements
ceil
Round toward positive infinityfix
Round toward zerofloor
Round toward negative infinitymod
Remainder after division (modulo operation)rem
Remainder after divisionround
Round to nearest decimal or integer
sin
Sine of argument in radianssind
Sine of argument in degreesasin
Inverse sine in radiansasind
Inverse sine in degreessinh
Hyperbolic sine of argument in radiansasinh
Inverse hyperbolic sine
cos
Cosine of argument in radianscosd
Cosine of argument in degreesacos
Inverse cosine in radiansacosd
Inverse cosine in degreescosh
Hyperbolic cosineacosh
Inverse hyperbolic cosine
tan
Tangent of argument in radianstand
Tangent of argument in degreesatan
Inverse tangent in radiansatand
Inverse tangent in degreesatan2
Four-quadrant inverse tangentatan2d
Four-quadrant inverse tangent in degreestanh
Hyperbolic tangentatanh
Inverse hyperbolic tangent
exp
Exponentiallog
Natural logarithmlog10
Common logarithm (base 10)log2
Base 2 logarithm and dissect floating-point numbers into exponent and mantissasqrt
Square root
abs
Absolute value and complex magnitudeangle
Phase angleconj
Complex conjugatesign
Sign function (signum function)
gcd
Greatest common divisorlcm
Least common multiplerat
Rational fraction approximationrats
Rational output
Inf
Infinitypi
Ratio of circle’s circumference to its diameternatural constant
euler constant
NaN
Not-a-Numberisfinite
Array elements that are finiteisinf
Array elements that are infiniteisnan
Array elements that are NaN
mldivide
Solve systems of linear equations Ax = B for xmrdivide
Solve systems of linear equations xA = B for xinv
Matrix inversepinv
Moore-Penrose pseudoinverse of matrix
lu
LU matrix factorization
transpose
Transpose vector or matrixctranspose
Complex conjugate transposemtimes
Matrix Multiplicationmpower
Matrix power
rank
Rank of matrixtrace
Sum of diagonal elements
rand
Uniformly distributed random numbersrandn
Normally distributed random numbersrandi
Uniformly distributed pseudorandom integers
rng
Control random number generation
Attension: this function needs GnuPlot interface.
load
Load variables from file into workspace
audioread
Read audio fileaudiowrite
Write audio file
imwrite
Write image to graphics file
min
Smallest elements in arraymax
Largest elements in arraybounds
Smallest and largest elementsmean
Average or mean value of arraymedian
Median value of array
spalloc
Allocate space for sparse matrixspdiags
Extract and create sparse band and diagonal matrices comingspeye
Sparse identity matrixsprand
Sparse uniformly distributed random matrix comingsprandn
Sparse normally distributed random matrix comingsparse
Create sparse matrix
issparse
Determine whether input is sparse comingnnz
Number of nonzero matrix elements