18#ifndef VNLSparseLUSolverTraits_h
19#define VNLSparseLUSolverTraits_h
26#if __has_include(<itkConfigure.h>)
27# include <itkConfigure.h>
28# if defined(ITK_FUTURE_LEGACY_REMOVE)
29# error "VNLSparseLUSolverTraits is removed; use SparseLUSolverTraits (SparseLUSolverTraits.h, Eigen::SparseLU)."
30# elif defined(ITK_LEGACY_REMOVE) && !defined(ITK_LEGACY_SILENT) && !defined(ITK_LEGACY_TEST)
32# pragma message("VNLSparseLUSolverTraits is deprecated; migrate to SparseLUSolverTraits (Eigen::SparseLU).")
34# warning "VNLSparseLUSolverTraits is deprecated; migrate to SparseLUSolverTraits (Eigen::SparseLU)."
39#include "vnl/vnl_vector.h"
40#include "vnl/vnl_sparse_matrix.h"
41#include "vnl/algo/vnl_sparse_lu.h"
59template <
typename T =
double>
122 Solve(solver, iB, oX);
139 Solve(solver, iBx, iBy, iBz, oX, oY, oZ);
149 Solve(solver, iBx, iBy, oX, oY);
158 oX = solver.solve(iB);
172 oX = solver.solve(iBx);
173 oY = solver.solve(iBy);
174 oZ = solver.solve(iBz);
182 oX = solver.solve(iBx);
183 oY = solver.solve(iBy);
Generic interface for sparse LU solver.
static MatrixType InitializeSparseMatrix(const unsigned int &iRow, const unsigned int &iCol)
initialize a sparse matrix of size iRow x iCol
static void Solve(SolverType &solver, const VectorType &iBx, const VectorType &iBy, VectorType &oX, VectorType &oY)
Solve the linear systems: , factoring the internal matrix if needed.
static bool Solve(const MatrixType &iA, const VectorType &iB, VectorType &oX)
Solve the linear system .
vnl_vector< ValueType > VectorType
vnl_sparse_matrix< ValueType > MatrixType
static bool IsDirectSolver()
static void Solve(SolverType &solver, const VectorType &iB, VectorType &oX)
Solve the linear system factoring the internal matrix if needed.
static MatrixType InitializeSparseMatrix(const unsigned int &iN)
initialize a square sparse matrix of size iN x iN
static void MatVecMult(const MatrixType &iA, const VectorType &iB, VectorType &oX)
oX = iA * iB
static void FillMatrix(MatrixType &iA, const unsigned int &iR, const unsigned int &iC, const ValueType &iV)
iA[iR][iC] = iV
static bool Solve(const MatrixType &iA, const VectorType &iBx, const VectorType &iBy, const VectorType &iBz, VectorType &oX, VectorType &oY, VectorType &oZ)
Solve the linear systems: , , .
static bool Solve(const MatrixType &iA, const VectorType &iBx, const VectorType &iBy, VectorType &oX, VectorType &oY)
Solve the linear systems: , .
static VectorType InitializeVector(const unsigned int &iN)
initialize a vector of size iN
static void Solve(SolverType &solver, const VectorType &iBx, const VectorType &iBy, const VectorType &iBz, VectorType &oX, VectorType &oY, VectorType &oZ)
Solve the linear systems: , , factoring the internal matrix if needed.
static void AddToMatrix(MatrixType &iA, const unsigned int &iR, const unsigned int &iC, const ValueType &iV)
iA[iR][iC] += iV