-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e114bf8
commit 62355de
Showing
4 changed files
with
73 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright (C) 2019(-2023) Reinhard <[email protected]> | ||
// Copyright (C) 2019(-2024) Reinhard <[email protected]> | ||
|
||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -150,7 +150,7 @@ class UmfpackObject : public octave_base_value { | |
UmfpackObject(); | ||
explicit UmfpackObject(const SparseMatrixType& A, const Options& options); | ||
virtual ~UmfpackObject(void); | ||
DenseMatrixType solve(const DenseMatrixType& b); | ||
DenseMatrixType solve(const DenseMatrixType& b, SuiteSparse_long sys); | ||
virtual bool is_constant(void) const{ return true; } | ||
virtual bool is_defined(void) const{ return true; } | ||
virtual dim_vector dims (void) const { return oMat.dims(); } | ||
|
@@ -245,7 +245,7 @@ UmfpackObject<T>::~UmfpackObject() | |
} | ||
|
||
template <typename T> | ||
typename UmfpackObject<T>::DenseMatrixType UmfpackObject<T>::solve(const DenseMatrixType& b) | ||
typename UmfpackObject<T>::DenseMatrixType UmfpackObject<T>::solve(const DenseMatrixType& b, SuiteSparse_long sys) | ||
{ | ||
DenseMatrixType x(b.rows(), b.columns()); | ||
|
||
|
@@ -255,7 +255,7 @@ typename UmfpackObject<T>::DenseMatrixType UmfpackObject<T>::solve(const DenseMa | |
const T* const bp = b.data(); | ||
|
||
for (octave_idx_type j = 0; j < b.columns(); ++j) { | ||
auto status = oMat.umfpack_solve(UMFPACK_A, | ||
auto status = oMat.umfpack_solve(sys, | ||
xp + j * n, | ||
bp + j * n, | ||
Numeric, | ||
|
@@ -411,6 +411,12 @@ octave_value_list UmfpackObject<T>::eval(const octave_value_list& args, int narg | |
} | ||
} | ||
|
||
SuiteSparse_long sys = UMFPACK_A; | ||
|
||
if (args.length() > iarg) { | ||
sys = args(iarg++).long_value(); | ||
} | ||
|
||
try { | ||
if (bHaveMatrix) { | ||
pUmfpack = new UmfpackObjectType{A, options}; | ||
|
@@ -419,7 +425,7 @@ octave_value_list UmfpackObject<T>::eval(const octave_value_list& args, int narg | |
} | ||
|
||
if (bHaveRightHandSide) { | ||
retval.append(pUmfpack->solve(b)); | ||
retval.append(pUmfpack->solve(b, sys)); | ||
|
||
if (bOwnUmfpack) { | ||
delete pUmfpack; | ||
|