Blender  V3.3
linear_solver.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2004 Bruno Levy.
3  * 2005-2015 Blender Foundation. */
4 
10 #pragma once
11 
12 #include <stdbool.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /* Solvers for Ax = b and AtAx = Atb */
19 
20 typedef struct LinearSolver LinearSolver;
21 
22 LinearSolver *EIG_linear_solver_new(int num_rows, int num_columns, int num_right_hand_sides);
23 
25  int num_columns,
26  int num_right_hand_sides);
27 
29 
30 /* Variables (x). Any locking must be done before matrix construction. */
31 
32 void EIG_linear_solver_variable_set(LinearSolver *solver, int rhs, int index, double value);
33 double EIG_linear_solver_variable_get(LinearSolver *solver, int rhs, int index);
34 void EIG_linear_solver_variable_lock(LinearSolver *solver, int index);
35 void EIG_linear_solver_variable_unlock(LinearSolver *solver, int index);
36 
37 /* Matrix (A) and right hand side (b) */
38 
39 void EIG_linear_solver_matrix_add(LinearSolver *solver, int row, int col, double value);
40 void EIG_linear_solver_right_hand_side_add(LinearSolver *solver, int rhs, int index, double value);
41 
42 /* Solve. Repeated solves are supported, by changing b between solves. */
43 
45 
46 /* Debugging */
47 
49 
50 #ifdef __cplusplus
51 }
52 #endif
uint col
void EIG_linear_solver_print_matrix(LinearSolver *solver)
LinearSolver * EIG_linear_solver_new(int num_rows, int num_columns, int num_right_hand_sides)
void EIG_linear_solver_variable_set(LinearSolver *solver, int rhs, int index, double value)
void EIG_linear_solver_right_hand_side_add(LinearSolver *solver, int rhs, int index, double value)
void EIG_linear_solver_variable_unlock(LinearSolver *solver, int index)
void EIG_linear_solver_delete(LinearSolver *solver)
LinearSolver * EIG_linear_least_squares_solver_new(int num_rows, int num_columns, int num_right_hand_sides)
double EIG_linear_solver_variable_get(LinearSolver *solver, int rhs, int index)
void EIG_linear_solver_matrix_add(LinearSolver *solver, int row, int col, double value)
bool EIG_linear_solver_solve(LinearSolver *solver)
void EIG_linear_solver_variable_lock(LinearSolver *solver, int index)