hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Linear_equation Class Referenceabstract

represents a linear equation in an arbitrary vector space with a black-box operator More...

#include <Linear_equation.hpp>

Inheritance diagram for hexed::Linear_equation:
hexed::Dense_equation

Public Member Functions

virtual int n_vecs ()=0
 number of vectors this object provides access to (including 0 and 1)
 
virtual void scale (int output, int input, double scalar)=0
 scales vector input by scalar and writes the result to vector output
 
virtual void add (int output, double coef0, int vec0, double coef1, int vec1)=0
 assigns \( z = ax + by \) where \( z, a, x, b, y \) are given by the arguments in order
 
virtual double inner (int input0, int input1)=0
 returns the inner product of the two vectors specified by the inputs
 
double norm (int input)
 norm induced by inner()
 
virtual void matvec (int output, int input)=0
 computes the product of the operator \( A \) with vector input and writes it to output.
 

Detailed Description

represents a linear equation in an arbitrary vector space with a black-box operator

represents an equation of the form \( Ax = b \). This object manages (or has access to) storage for some number of vectors indexed 0 to n_vecs(). The member functions of this class provide basic vector operations including addition, scalar multiplication, and inner products as well as matvec() to compute matrix-vector products. Derived classes may also implement other ways to access the vector values. Vector 0 is the current best estimate for the solution \( x \) and vector 1 is the right hand side \( b \). All other vectors are available for solver algorithms to use.

Note
In the member functions below, any number of the output and/or input vectors may be the same. Derived classes must be implemented in such a way that this does not create aliasing problems.
This clas was created in order to experiment with implicit solvers. It is not used in any of the production-level code to date.

Member Function Documentation

◆ add()

virtual void hexed::Linear_equation::add ( int output,
double coef0,
int vec0,
double coef1,
int vec1 )
pure virtual

assigns \( z = ax + by \) where \( z, a, x, b, y \) are given by the arguments in order

Implemented in hexed::Dense_equation.

◆ inner()

virtual double hexed::Linear_equation::inner ( int input0,
int input1 )
pure virtual

returns the inner product of the two vectors specified by the inputs

Implemented in hexed::Dense_equation.

◆ matvec()

virtual void hexed::Linear_equation::matvec ( int output,
int input )
pure virtual

computes the product of the operator \( A \) with vector input and writes it to output.

Implemented in hexed::Dense_equation.

◆ n_vecs()

virtual int hexed::Linear_equation::n_vecs ( )
pure virtual

number of vectors this object provides access to (including 0 and 1)

Implemented in hexed::Dense_equation.

◆ scale()

virtual void hexed::Linear_equation::scale ( int output,
int input,
double scalar )
pure virtual

scales vector input by scalar and writes the result to vector output

Implemented in hexed::Dense_equation.


The documentation for this class was generated from the following files: