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
953f7edc
Commit
953f7edc
authored
3 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Review/Update Faust.isdense doc.
parent
7e10ccf8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wrapper/matlab/+matfaust/@Faust/Faust.m
+51
-0
51 additions, 0 deletions
wrapper/matlab/+matfaust/@Faust/Faust.m
wrapper/python/pyfaust.py
+36
-0
36 additions, 0 deletions
wrapper/python/pyfaust.py
with
87 additions
and
0 deletions
wrapper/matlab/+matfaust/@Faust/Faust.m
+
51
−
0
View file @
953f7edc
...
...
@@ -1296,6 +1296,57 @@ classdef Faust
%==========================================================================================
%> @brief Returns true if F factors are all dense matrices/arrays false otherwise.
%>
%> @b Example
%> @code
%> >> F = matfaust.rand(10, 10, 'fac_type', 'dense')
%>
%> F =
%>
%> Faust size 10x10, density 2.5, nnz_sum 250, 5 factor(s):
%> - FACTOR 0 (double) DENSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 1 (double) DENSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 2 (double) DENSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 3 (double) DENSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 4 (double) DENSE, size 10x10, density 0.5, nnz 50
%> >> isdense(F)
%>
%> ans =
%>
%> 1
%>
%> >> F = matfaust.rand(10, 10, 'fac_type', 'sparse')
%>
%> F =
%>
%> Faust size 10x10, density 2.5, nnz_sum 250, 5 factor(s):
%> - FACTOR 0 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 1 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 2 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 3 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 4 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> >> isdense(F)
%>
%> ans =
%>
%> 0
%>
%> >> F = matfaust.rand(10, 10, 'fac_type', 'mixed')
%>
%> F =
%>
%> Faust size 10x10, density 2.5, nnz_sum 250, 5 factor(s):
%> - FACTOR 0 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 1 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 2 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 3 (double) DENSE, size 10x10, density 0.5, nnz 50
%> - FACTOR 4 (double) SPARSE, size 10x10, density 0.5, nnz 50
%> >> isdense(F)
%>
%> ans =
%>
%> 0
%>
%> @endcode
%==========================================================================================
function
is_dense
=
isdense
(
F
)
is_dense
=
call_mex
(
F
,
'is_all_dense'
);
...
...
This diff is collapsed.
Click to expand it.
wrapper/python/pyfaust.py
+
36
−
0
View file @
953f7edc
...
...
@@ -2094,6 +2094,42 @@ class Faust(numpy.lib.mixins.NDArrayOperatorsMixin):
def
isdense
(
F
):
"""
Returns True if all factors are dense arrays (as np.ndarray-s) False otherwise.
Example:
>>>
import
pyfaust
as
pf
>>>
F
=
pf
.
rand
(
10
,
10
,
fac_type
=
'
sparse
'
)
>>>
F
Faust
size
10
x10
,
density
2.5
,
nnz_sum
250
,
5
factor
(
s
):
-
FACTOR
0
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
1
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
2
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
3
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
4
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
>>>
F
.
isdense
()
False
>>>
F
=
pf
.
rand
(
10
,
10
,
fac_type
=
'
dense
'
)
>>>
F
Faust
size
10
x10
,
density
2.5
,
nnz_sum
250
,
5
factor
(
s
):
-
FACTOR
0
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
1
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
2
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
3
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
4
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
>>>
F
.
isdense
()
True
>>>
F
=
pf
.
rand
(
10
,
10
,
fac_type
=
'
mixed
'
)
>>>
F
Faust
size
10
x10
,
density
2.5
,
nnz_sum
250
,
5
factor
(
s
):
-
FACTOR
0
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
1
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
2
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
3
(
double
)
DENSE
,
size
10
x10
,
density
0.5
,
nnz
50
-
FACTOR
4
(
double
)
SPARSE
,
size
10
x10
,
density
0.5
,
nnz
50
>>>
F
.
isdense
()
False
"""
return
F
.
m_faust
.
is_all_dense
()
...
...
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