opatIO-cpp 0.3.0a
Open Parametrized Array Table
Loading...
Searching...
No Matches
opat::lattice Namespace Reference

Namespace for table lattice interpolation of OPAT files. More...

Classes

struct  Simplex
 Represents a simplex containing a point, along with barycentric weights. More...
 
class  TableLattice
 Represents a lattice structure for interpolating data from an OPAT object. More...
 

Typedefs

typedef boost::numeric::ublas::matrix< double > bmat
 Typedef for a Boost uBLAS matrix of doubles.
 
typedef boost::numeric::ublas::vector< double > bvec
 Typedef for a Boost uBLAS vector of doubles.
 

Enumerations

enum class  InterpolationType { Linear , Quadratic , Cubic }
 Defines the type of interpolation to be used. More...
 

Functions

bvec solveLinearSystem (bmat A, bvec b)
 Solves a linear system of equations Ax = b.
 

Detailed Description

Namespace for table lattice interpolation of OPAT files.

Typedef Documentation

◆ bmat

typedef boost::numeric::ublas::matrix<double> opat::lattice::bmat

Typedef for a Boost uBLAS matrix of doubles.

◆ bvec

typedef boost::numeric::ublas::vector<double> opat::lattice::bvec

Typedef for a Boost uBLAS vector of doubles.

Enumeration Type Documentation

◆ InterpolationType

Defines the type of interpolation to be used.

Enumerator
Linear 

Linear interpolation.

Quadratic 

Quadratic interpolation (Not yet implemented).

Cubic 

Cubic interpolation (Not yet implemented).

Function Documentation

◆ solveLinearSystem()

bvec opat::lattice::solveLinearSystem ( bmat A,
bvec b )

Solves a linear system of equations Ax = b.

Uses LU decomposition to solve the system.

Parameters
AThe matrix A.
bThe vector b.
Returns
The solution vector x.
Exceptions
std::runtime_errorif matrix dimensions are mismatched or LU factorization fails.

Example:

// Solves Ax = b for x
opat::lattice::bmat A(2, 2); // 2x2 matrix
A(0, 0) = 2.0; A(0, 1) = 1.0;
A(1, 0) = 1.0; A(1, 1) = 3.0;
opat::lattice::bvec b(2); // 2-element vector
b(0) = 5.0;
b(1) = 7.0;
// x should be approximately [1.6, 1.8]
std::cout << "Solution x: " << x << std::endl;
boost::numeric::ublas::vector< double > bvec
Typedef for a Boost uBLAS vector of doubles.
Definition tableLattice.h:25
boost::numeric::ublas::matrix< double > bmat
Typedef for a Boost uBLAS matrix of doubles.
Definition tableLattice.h:21
bvec solveLinearSystem(bmat A, bvec b)
Solves a linear system of equations Ax = b.
Definition tableLattice.cpp:517