| /* ----------------------------------------------------------------------------- |
| * Test sparse Linear Systems |
| * -------------------------------------------------------------------------- */ |
| |
| DROP TABLE IF EXISTS "Sparse_linear_systems_lhs"; |
| CREATE TABLE "Sparse_linear_systems_lhs" ( |
| "Rid" INTEGER NOT NULL, |
| cid INTEGER, |
| val DOUBLE PRECISION |
| ); |
| |
| DROP TABLE IF EXISTS "Sparse_linear_systems_rhs"; |
| CREATE TABLE "Sparse_linear_systems_rhs" ( |
| "Rid" INTEGER NOT NULL, |
| val DOUBLE PRECISION |
| ); |
| |
| |
| INSERT INTO "Sparse_linear_systems_lhs"("Rid", cid, val) VALUES |
| (0, 0, 1), |
| (1, 1, 1), |
| (2, 2, 1), |
| (3, 3, 1); |
| |
| INSERT INTO "Sparse_linear_systems_rhs"("Rid", val) VALUES |
| (0, 1), |
| (1, 1), |
| (2, 1); |
| |
| -- Note: This install check is meant to check that all the functions exposed to |
| -- the user work. |
| |
| -- Checks for the function usage |
| select linear_solver_sparse('help'); |
| select linear_solver_sparse('usage'); |
| |
| |
| -- CHECK : Make sure all possible default calls work |
| drop table if exists result_table; |
| select linear_solver_sparse( |
| '"Sparse_linear_systems_lhs"', |
| '"Sparse_linear_systems_rhs"', |
| 'result_table', |
| '"Rid"', |
| 'cid', |
| 'val', |
| '"Rid"', |
| 'val', |
| 4); |
| |
| drop table if exists result_table; |
| select linear_solver_sparse( |
| '"Sparse_linear_systems_lhs"', |
| '"Sparse_linear_systems_rhs"', |
| 'result_table', |
| '"Rid"', |
| 'cid', |
| 'val', |
| '"Rid"', |
| 'val', |
| 4, |
| NULL); |
| |
| drop table if exists result_table; |
| select linear_solver_sparse( |
| '"Sparse_linear_systems_lhs"', |
| '"Sparse_linear_systems_rhs"', |
| 'result_table', |
| '"Rid"', |
| 'cid', |
| 'val', |
| '"Rid"', |
| 'val', |
| 4, |
| NULL, |
| 'direct'); |
| |
| drop table if exists result_table; |
| select linear_solver_sparse( |
| '"Sparse_linear_systems_lhs"', |
| '"Sparse_linear_systems_rhs"', |
| 'result_table', |
| '"Rid"', |
| 'cid', |
| 'val', |
| '"Rid"', |
| 'val', |
| 4, |
| NULL, |
| 'direct', |
| 'algorithm=ldlt'); |
| |