Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
faust group
faust
Commits
421e4e19
Commit
421e4e19
authored
2 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Add set_row/col_coeffs overloads in Faust::MatDense<FPP, Cpu>.
parent
0e534907
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/faust_linear_operator/CPU/faust_MatDense.h
+2
-0
2 additions, 0 deletions
src/faust_linear_operator/CPU/faust_MatDense.h
src/faust_linear_operator/CPU/faust_MatDense.hpp
+27
-0
27 additions, 0 deletions
src/faust_linear_operator/CPU/faust_MatDense.hpp
with
29 additions
and
0 deletions
src/faust_linear_operator/CPU/faust_MatDense.h
+
2
−
0
View file @
421e4e19
...
...
@@ -558,11 +558,13 @@ namespace Faust
* Assigns this[row_ids[i], col_id] to values[i, val_col_id] for each i in {0, ..., row_ids.size()}.
*/
void
set_col_coeffs
(
faust_unsigned_int
col_id
,
const
std
::
vector
<
int
>
&
row_ids
,
const
MatDense
<
FPP
,
Cpu
>
&
values
,
faust_unsigned_int
val_col_id
);
void
set_col_coeffs
(
faust_unsigned_int
col_id
,
const
std
::
vector
<
int
>
&
row_ids
,
const
FPP
*
values
,
faust_unsigned_int
val_col_id
,
faust_unsigned_int
values_nrows
);
/**
* Assigns this[row_id, col_ids[j]] to values[val_row_id, j] for each j in {0, ..., col_ids.size()}.
*/
void
set_row_coeffs
(
faust_unsigned_int
row_id
,
const
std
::
vector
<
int
>
&
col_ids
,
const
MatDense
<
FPP
,
Cpu
>
&
values
,
faust_unsigned_int
val_row_id
);
void
set_row_coeffs
(
faust_unsigned_int
row_id
,
const
std
::
vector
<
int
>
&
col_ids
,
const
FPP
*
values
,
faust_unsigned_int
val_row_id
,
faust_unsigned_int
values_nrows
);
bool
containsNaN
()
const
;
...
...
This diff is collapsed.
Click to expand it.
src/faust_linear_operator/CPU/faust_MatDense.hpp
+
27
−
0
View file @
421e4e19
...
...
@@ -1608,6 +1608,7 @@ void MatDense<FPP, Cpu>::submatrix(const std::vector<int> &row_ids, const std::v
template
<
typename
FPP
>
void
MatDense
<
FPP
,
Cpu
>::
set_col_coeffs
(
faust_unsigned_int
col_id
,
const
std
::
vector
<
int
>
&
row_ids
,
const
MatDense
<
FPP
,
Cpu
>
&
values
,
faust_unsigned_int
val_col_id
)
{
//TODO: use following set_col_coeffs with values.getData()
for
(
int
i
=
0
;
i
<
row_ids
.
size
();
i
++
)
{
auto
row_id
=
row_ids
[
i
];
...
...
@@ -1617,9 +1618,23 @@ void MatDense<FPP, Cpu>::set_col_coeffs(faust_unsigned_int col_id, const std::ve
this
->
isZeros
=
false
;
// too costly to verify exhaustively, in doubt say it is not 0
}
template
<
typename
FPP
>
void
MatDense
<
FPP
,
Cpu
>::
set_col_coeffs
(
faust_unsigned_int
col_id
,
const
std
::
vector
<
int
>
&
row_ids
,
const
FPP
*
values
,
faust_unsigned_int
val_col_id
,
faust_unsigned_int
values_nrows
)
{
for
(
int
i
=
0
;
i
<
row_ids
.
size
();
i
++
)
{
auto
row_id
=
row_ids
[
i
];
mat
(
row_id
,
col_id
)
=
*
(
values
+
values_nrows
*
val_col_id
+
i
);
// values(i, val_col_id)
}
// this->isZeros = this->getNonZeros() == 0;
this
->
isZeros
=
false
;
// too costly to verify exhaustively, in doubt say it is not 0
}
template
<
typename
FPP
>
void
MatDense
<
FPP
,
Cpu
>::
set_row_coeffs
(
faust_unsigned_int
row_id
,
const
std
::
vector
<
int
>
&
col_ids
,
const
MatDense
<
FPP
,
Cpu
>
&
values
,
faust_unsigned_int
val_row_id
)
{
//TODO: use following set_row_coeffs with values.getData() and values.getNbRow()
for
(
int
i
=
0
;
i
<
col_ids
.
size
();
i
++
)
{
auto
col_id
=
col_ids
[
i
];
...
...
@@ -1629,6 +1644,18 @@ void MatDense<FPP, Cpu>::set_row_coeffs(faust_unsigned_int row_id, const std::ve
this
->
isZeros
=
false
;
// too costly to verify exhaustively, in doubt say it is not 0
}
template
<
typename
FPP
>
void
MatDense
<
FPP
,
Cpu
>::
set_row_coeffs
(
faust_unsigned_int
row_id
,
const
std
::
vector
<
int
>
&
col_ids
,
const
FPP
*
values
,
faust_unsigned_int
val_row_id
,
faust_unsigned_int
values_nrows
)
{
for
(
int
i
=
0
;
i
<
col_ids
.
size
();
i
++
)
{
auto
col_id
=
col_ids
[
i
];
mat
(
row_id
,
col_id
)
=
*
(
values
+
values_nrows
*
i
+
val_row_id
);
//values(val_row_id, i);
}
// this->isZeros = this->getNonZeros() == 0;
this
->
isZeros
=
false
;
// too costly to verify exhaustively, in doubt say it is not 0
}
template
<
typename
FPP
>
FPP
MatDense
<
FPP
,
Cpu
>::
sum_col
(
faust_unsigned_int
id
)
const
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment