accelerInt
v0.1
|
Implementation of various linear algebra functions needed in the exponential integrators. More...
Go to the source code of this file.
Functions | |
static void | matvec_m_by_m (const int m, const double *__restrict__ A, const double *__restrict__ V, double *__restrict__ Av) |
Matrix-vector multiplication of a matrix sized MxM and a vector Mx1. More... | |
static void | matvec_m_by_m_plusequal (const int m, const double *__restrict__ A, const double *__restrict__ V, double *__restrict__ Av) |
Matrix-vector plus equals for a matrix of size MxM and vector of size Mx1. That is, it returns (A + I) * v. More... | |
static void | matvec_n_by_m_scale (const int m, const double scale, const double *__restrict__ A, const double *__restrict__ V, double *__restrict__ Av) |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor That is, it returns A * v * scale. More... | |
static void | matvec_n_by_m_scale_special (const int m, const double *__restrict__ scale, const double *__restrict__ A, const double **__restrict__ V, double **__restrict__ Av) |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor. More... | |
static void | matvec_n_by_m_scale_special2 (const int m, const double *__restrict__ scale, const double *__restrict__ A, const double **__restrict__ V, double **__restrict__ Av) |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor. More... | |
static void | matvec_n_by_m_scale_add (const int m, const double scale, const double *__restrict__ A, const double *__restrict__ V, double *__restrict__ Av, const double *__restrict__ add) |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor and added to another vector. More... | |
static void | matvec_n_by_m_scale_add_subtract (const int m, const double scale, const double *__restrict__ A, const double *__restrict__ V, double *__restrict__ Av, const double *__restrict__ add, const double *__restrict__ sub) |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor and adds and subtracts the specified vectors note, the addition is twice the specified vector. More... | |
static void | scale (const double *__restrict__ y0, const double *__restrict__ y1, double *__restrict__ sc) |
Get scaling for weighted norm. More... | |
static void | scale_init (const double *__restrict__ y0, double *__restrict__ sc) |
Get scaling for weighted norm for the initial timestep (used in krylov process) More... | |
static double | sc_norm (const double *__restrict__ nums, const double *__restrict__ sc) |
Perform weighted norm. More... | |
static double | two_norm (const double *__restrict__ v) |
Computes and returns the two norm of a vector. More... | |
static double | normalize (const double *__restrict__ v, double *__restrict__ v_out) |
Normalize the input vector using a 2-norm. More... | |
static double | dotproduct (const double *__restrict__ w, const double *__restrict__ Vm) |
Performs the dot product of the w (NSP x 1) vector with the given subspace vector (NSP x 1) More... | |
static void | scale_subtract (const double s, const double *__restrict__ Vm, double *__restrict__ w) |
Subtracts Vm scaled by s from w. More... | |
static void | scale_mult (const double s, const double *__restrict__ w, double *__restrict__ Vm) |
Sets Vm to s * w. More... | |
Implementation of various linear algebra functions needed in the exponential integrators.
Definition in file exponential_linear_algebra.h.
|
inlinestatic |
Performs the dot product of the w (NSP x 1) vector with the given subspace vector (NSP x 1)
returns \(Vm \dot w\)
[in] | w | the vector with with to dot |
[in] | Vm | the subspace vector |
Definition at line 356 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector multiplication of a matrix sized MxM and a vector Mx1.
[in] | m | size of the matrix |
[in] | A | matrix of size MxM |
[in] | V | vector of size Mx1 |
[out] | Av | vector that is A * v |
Definition at line 28 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector plus equals for a matrix of size MxM and vector of size Mx1. That is, it returns (A + I) * v.
[in] | m | size of the matrix |
[in] | A | matrix of size MxM |
[in] | V | vector of size Mx1 |
[out] | Av | vector that is (A + I) * v |
Definition at line 54 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor That is, it returns A * v * scale.
[in] | m | size of the matrix |
[in] | scale | a number to scale the multplication by |
[in] | A | matrix |
[in] | V | the vector |
[out] | Av | vector that is A * V * scale |
Definition at line 84 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor and added to another vector.
Computes \(A * V * scale + add\)
[in] | m | size of the matrix |
[in] | scale | a number to scale the multplication by |
[in] | add | the vector to add to the result |
[in] | A | matrix |
[in] | V | the vector |
[out] | Av | vector that is A * V * scale + add |
Definition at line 193 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor and adds and subtracts the specified vectors note, the addition is twice the specified vector.
Computes \(scale * A * V + 2 * add - sub\)
[in] | m | size of the matrix |
[in] | scale | a number to scale the multplication by |
[in] | A | matrix |
[in] | V | the vector |
[out] | Av | vector that is scale * A * V + 2 * add - sub |
[in] | add | the vector to add to the result |
[in] | sub | the vector to subtract from the result |
Definition at line 227 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor.
Computes the following: \(Av1 = A * V1 * scale[0]\), \(Av2 = A * V2 * scale[1]\), and \(Av3 = A * V3 * scale[2] + V4 + V5\)
[in] | m | size of the matrix |
[in] | scale | a list of numbers to scale the multplication by |
[in] | A | matrix |
[in] | V | a list of 5 pointers corresponding to V1, V2, V3, V4, V5 |
[out] | Av | a list of 3 pointers corresponding to Av1, Av2, Av3 |
Definition at line 118 of file exponential_linear_algebra.h.
|
inlinestatic |
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified factor.
Computes the following: \(Av1 = A * V1 * scale[0]\) and: \(Av2 = A * V2 * scale[1]\)
Performs inline matrix-vector multiplication (with unrolled loops)
[in] | m | size of the matrix |
[in] | scale | a list of numbers to scale the multplication by |
[in] | A | matrix |
[in] | V | a list of 2 pointers corresponding to V1, V2 |
[out] | Av | a list of 2 pointers corresponding to Av1, Av2 |
Definition at line 158 of file exponential_linear_algebra.h.
|
inlinestatic |
Normalize the input vector using a 2-norm.
\(v_{out} = \frac{v}{\left| v \right|}_2\)
[in] | v | vector to be normalized |
[out] | v_out | where to stick the normalized part of v (in a column) |
Definition at line 330 of file exponential_linear_algebra.h.
|
inlinestatic |
Perform weighted norm.
Computes \(\left| nums * sc\right|_2\)
[in] | nums | values to be normed |
[in] | sc | scaling array for norm |
Definition at line 293 of file exponential_linear_algebra.h.
|
inlinestatic |
Get scaling for weighted norm.
Computes \(\frac{1.0}{ATOL + \max\left(\left|y0\right|, \left|y1\right|) * RTOL\right)}\)
[in] | y0 | values at current timestep |
[in] | y1 | values at next timestep |
[out] | sc | array of scaling values |
Definition at line 258 of file exponential_linear_algebra.h.
|
inlinestatic |
Get scaling for weighted norm for the initial timestep (used in krylov process)
[in] | y0 | values at current timestep |
[out] | sc | array of scaling values |
Definition at line 274 of file exponential_linear_algebra.h.
|
inlinestatic |
Sets Vm to s * w.
\(Vm = s * w\)
[in] | s | the scale multiplier to use |
[in] | w | the vector to use as a base |
[out] | Vm | the subspace matrix to set |
Definition at line 395 of file exponential_linear_algebra.h.
|
inlinestatic |
Subtracts Vm scaled by s from w.
\( w -= Vm * s\)
[in] | s | the scale multiplier to use |
[in] | Vm | the subspace matrix |
[out] | w | the vector to subtract from |
Definition at line 376 of file exponential_linear_algebra.h.
|
inlinestatic |
Computes and returns the two norm of a vector.
Computes \(\sqrt{\sum{v^2}}\)
[in] | v | the vector |
Definition at line 311 of file exponential_linear_algebra.h.