Commit Graph

55 Commits

Author SHA1 Message Date
Vladimir Chalupecky
82e11dfec8 mat: add PivotedCholesky 2023-08-19 13:00:55 +02:00
Dan Kortschak
5f0141ca4c all: run gofmt and generate all packages
Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.

[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card

git checkout -- dsp/fourier/internal/fftpack
2022-08-06 07:05:17 +09:30
Vladimir Chalupecky
5c9be58381 mat,stat: refer to SymmetricDim in docs 2021-09-11 23:11:30 +02:00
Dan Kortschak
3d32334f97 mat: rename Symmetric method to SymmetricDim 2021-08-23 07:02:27 +09:30
Yasuhiro Matsumoto
23653ebacb mat: fix typo 2021-07-14 12:07:06 +09:30
Dan Kortschak
efbee9bf28 mat: rename pool helpers to be consistent with type names 2021-05-27 17:07:31 +09:30
Dan Kortschak
b721908ce4 mat: document that Condition errors are returned by Cholesky methods 2020-11-03 14:11:16 +10:30
Vladimir Chalupecky
971fc50f31 mat: add BandCholesky type 2020-09-28 09:54:56 +02:00
Vladimir Chalupecky
eb27e5325c mat: reuse matrix idiomatically in Cholesky 2020-09-28 09:54:56 +02:00
Dan Kortschak
e7a681e2c4 mat: fix up docs 2020-09-27 09:58:40 +09:30
jonreiter@gmail.com
3182a0783b mat: Cholesky.SymRankOne don't update receiver if singular 2020-05-05 18:24:23 +09:30
jonreiter@gmail.com
fdcf3da7c2 mat: use CopyVec per TODO, ref issue 167 2020-05-05 18:24:23 +09:30
Dan Kortschak
586a766cd0 mat: clean up lint
Missed in previous commit to mat.
2019-11-03 04:53:28 +10:30
Dan Kortschak
40fa6a493b mat: make SetFromU panic on non-empty size mismatch 2019-09-24 06:31:07 +09:30
Vladimir Chalupecky
bcfb93e049 mat: clean up docs 2019-09-22 18:24:17 +02:00
Brendan Tracey
16f4144126 mat: Change methods to accept empty instead of nil matrices (#1090)
* mat: Change methods to accept empty instead of nil matrices

While here, fix enough to compile.

Updates #1081.
2019-09-20 19:19:07 +01:00
Brendan Tracey
975d99cd20 mat,all: Rename IsZero to IsEmpty (#1088)
This avoids the confusion between Zero() and IsZero() which sounds like they should be related
to one another but are not. This makes IsEmpty the counterpart to Reset. Add check for Zero in allMatrix

Fixes #1083.
Updates #1081.
2019-09-15 13:53:29 +01:00
Brendan Tracey
cd52c4d030 mat: Expose ReuseAs method to help resizing (#1082)
* mat: Expose ReuseAs method to help resizing

Fixes #963
2019-09-14 09:17:29 +01:00
Dan Kortschak
17ea55aedb blas,lapack: clean up docs and comments
Apply (with manual curation after the fact):
* s/^T/U+1d40/g
* s/^H/U+1d34/g
* s/, {2,3}if / $1/g

Some additional manual editing of odd formatting.
2019-09-06 20:02:29 +09:30
Dan Kortschak
e704b2e393 mat: make Cholesky.SetFromU take a Triangular 2019-04-12 18:16:18 +09:30
Brendan Tracey
4b1617dbb0 mat: Add methods for Cholesky to implement Matrix and Symmetric (#928)
* mat: Add methods for Cholesky to implement Matrix and Symmetric

Fixes #919.
2019-03-29 23:07:04 +00:00
Dan Kortschak
c92de05278 mat: conform receiver name to convention
Also let VecDense.SolveVec do the allocation.
2019-03-28 13:23:04 +10:30
Brendan Tracey
a65628b4b5 mat: Rename Solve(Vec) to Solve(Vec)To (#922)
* mat: Rename Solve(Vec) to Solev(Vec)To

Fix #830.
2019-03-28 01:01:36 +00:00
Vladimir Chalupecky
db78fa5579 mat: check validity in Cholesky.Cond 2019-02-10 08:39:33 +01:00
Vladimir Chalupecky
9d4132a30c mat: use lapack64.Potri in Cholesky.InverseTo
Also,
 - make tricky shadowing conversion from a SymDense to a TriDense more
 explicit in Cholesky.ToSym,
 - add a benchmark for InverseTo:

name                        old time/op  new time/op  delta
CholeskyInverseTo/n=10-4    10.8µs ± 2%   3.2µs ± 1%  -70.16%  (p=0.008 n=5+5)
CholeskyInverseTo/n=100-4   1.07ms ± 2%  0.51ms ± 2%  -52.06%  (p=0.008 n=5+5)
CholeskyInverseTo/n=1000-4   713ms ± 1%   315ms ± 1%  -55.83%  (p=0.008 n=5+5)
2019-01-04 23:08:42 +01:00
Vladimir Chalupecky
d9936c37d4 mat: rewrite Cholesky.ToSym without calling SymOuterK
name                    old time/op  new time/op  delta
CholeskyToSym/n=10-4    2.65µs ± 2%  0.78µs ± 0%  -70.75%  (p=0.029 n=4+4)
CholeskyToSym/n=100-4    329µs ± 1%   124µs ± 0%  -62.33%  (p=0.029 n=4+4)
CholeskyToSym/n=1000-4   241ms ± 2%   175ms ± 0%  -27.34%  (p=0.029 n=4+4)
2018-12-24 20:32:52 +01:00
Brendan Tracey
572d9101fe blas64: add length field N to Vector
blas64: add length field N to Vector

Alongside, fix the implementation of mat.VecDense and mat.Diagonal, as well as other changes needed to fix this change.

Fixes #736.
2018-12-10 08:36:04 +00:00
Dan Kortschak
26c60db8b2 mat: quieten vet for unkeyed composite literals in importable code 2018-09-02 07:59:12 +09:30
Vladimir Chalupecky
929014505b blas/blas64: reorder struct fields
Reorder vector and matrix struct fields to match the order in which BLAS
routines accept them. This makes calls with inline declarations with
unnamed fields consistent and easier to understand.
2018-08-16 18:54:07 +02:00
Vladimir Chalupecky
0bf5c67a31 mat: use lapack64.Potrs in Cholesky 2018-07-30 09:03:01 +02:00
Brendan Tracey
4b0a9c6ea9 Fix Cholesky downdate and improve tests (#455)
* Fix Cholesky downdate and improve tests
2018-04-11 10:20:12 -06:00
Dan Kortschak
37b2756f7a mat: correct destination 2018-02-23 09:17:16 +10:30
Dan Kortschak
64df69126c mat: harmonise parameter naming and documentation 2018-02-23 09:17:16 +10:30
kortschak
81efe7a867 mat: generalise Cholesky SymRankOne vector parameter 2018-01-12 08:22:41 +10:30
kortschak
a361656bfc mat: generalise SolveVec vector parameters 2017-12-31 21:19:18 +10:30
Vladimír Chalupecký
82b508537e mat: fix docs and error check in Cholesky.ExtendVecSym 2017-11-18 23:24:30 +01:00
Brendan Tracey
23014c0119 mat: add ability to compute the Cholesky when adding a row and column… (#298)
* mat: add ability to compute the Cholesky when adding a row and column to the factorized matrix
2017-11-16 17:11:32 -07:00
kortschak
805531d142 all: change capitalization of gonum in license header 2017-11-02 06:54:08 +10:30
kortschak
49a081d427 mat: don't confuse notions of zero
Replacement of isZero method calls elsewhere is done to avoid conflating
the zero concept with what we are actually asking: "Do we need to make a
matrix here?"
2017-10-24 16:30:21 +10:30
Brendan Tracey
3c877c5eba mat: Add RawU method to the Cholesky decomposition to directly expose… (#273)
* mat: Add RawU method to the Cholesky decomposition to directly expose the storage matrix

This is returned as Triangular rather than TriDense for two reasons
1) In the future, we may be able to optimize Cholesky, for instance by storing the decomposition as a banded matrix if the factorized matrix was banded. Returning as Triangular allows this to be robust to future modifications of Cholesky.
2) Normally one wants to return concrete types to allow maximum flexibility is using them, for example avoiding interface assertions. However, the opposite is true here. The user should not modify the returned data, and by returning a Triangular rather than a TriDense, this forces tricky code in order to be able to modify the returned matrix.

Fixes #270.
2017-10-19 20:50:26 -06:00
Brendan Tracey
ac9ad9e533 mat: Add Scale method for TriDense and Cholesky (#267)
* mat: Add Scale method for TriDense and Cholesky
2017-10-19 07:24:29 -06:00
Brendan Tracey
fa42c6938b mat: change cholesky.To to cholesky.ToSym (#250)
* mat: change cholesky.To to cholesky.ToSym

Fixes #133
2017-10-02 15:35:10 -06:00
Vladimir Chalupecky
d43614f6b3 mat: clarify implementation comments about condition number calculation 2017-08-08 22:47:37 +02:00
kortschak
fc1f4400f7 mat: export Dense.solveTwoChol as Cholesky.SolveChol 2017-08-03 06:21:30 +09:30
kortschak
862a4c5a4f mat: rename Vector->VecDense 2017-07-31 09:59:22 +09:30
kortschak
01a0286e0f mat: add IsZero method to resetable types 2017-07-06 14:15:39 +09:30
kortschak
08e1f7dfc1 mat: allow nil destination for Cholesky extraction 2017-07-06 13:49:14 +09:30
kortschak
1466bc5437 mat: move InverseCholesky onto Cholesky 2017-07-06 13:49:14 +09:30
kortschak
8dc3a3df20 mat: move SolveCholesky* onto Cholesky 2017-07-06 13:49:14 +09:30
kortschak
2a36f7a571 mat: rewrite cholesky extractions as To rather than From 2017-07-06 13:49:14 +09:30