Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3f3f06b2 authored by hhakim's avatar hhakim
Browse files

Minor changes.

- Update/Correct quick start READMEs.
- Change slightly the display of a Faust::Transform (and wrappers).
- Add a comment in postinst_matlab.sh script.
parent b9791a51
Branches
Tags
No related merge requests found
......@@ -22,13 +22,13 @@
<p>FAµST supports at least Python 2.7. For macOS it&rsquo;s the only version supported for now.</p>
<p>FAµST takes place in the Python ecosystem which as usual relies on numpy and scipy packages. So you have to ensure these packages are installed on your system.</p>
<p>FAµST is designed for the Python ecosystem which as usual relies on numpy and scipy packages. So you have to ensure these packages are installed on your system.</p>
<p>That requirement applies also to Python 3, assuming your version of Python is matching the version FAµST is compiled for (currently 3.6).</p>
<h3>1.2 For Matlab</h3>
<p>FAµST wrapper for Matlab has been tested on several Matlab versions starting from version 2016 up to version 2018. However it&rsquo;s not totally excluded that FAµST works with older versions.</p>
<p>The FAµST wrapper for Matlab has been tested on several Matlab versions starting from version 2016 up to version 2018. However it&rsquo;s not totally excluded that FAµST works with older versions.</p>
<h2><a name="installation"> 2. Installation</a></h2>
......@@ -37,7 +37,7 @@
<h2><a name="installation_testing">3. Installation Testing<a/></h2>
<p>Normally, after installing, nothing is left to do. The installation process should have seamlessly set up the Faust wrappers for Python and Matlab into your environment.
Neverthless, it could be useful to check that it really worked and set the environment manually in the contrary case like explained below.</p>
Neverthless, it could be useful to check that it really worked and set the environment manually if needed like explained below.</p>
<h3>3.1 Testing Python Wrapper Auto-Setup</h3>
......@@ -68,15 +68,15 @@ Neverthless, it could be useful to check that it really worked and set the envir
<h3>3.2 Testing Matlab Wrapper Auto-Setup</h3>
<pre><code> $ matlab -nodisplay -nojvm -r "import matfaust.Faust;F = Faust.rand(Faust.DENSE, Faust.COMPLEX, 1, 1, 10, 10, .5);exit"
<pre><code> $ matlab -nodisplay -nojvm -r "import matfaust.Faust;F = Faust.rand(1, 10, .5, 'dense', false);exit"
</code></pre>
<p>It worked only if you see an output similar to:</p>
<pre><code> F =
- Faust of size : 10x10, nb factor 1, RCG 1.75439,nnz 57
- FACTOR 0type : DENSE size 10x10, density 0.57, nnz 57
Faust size 10x10, density 0.56999, nnz_sum 57, 1 factor(s):
- FACTOR 0 (complex) DENSE, size 10x10, density 0.57, nnz 57
</code></pre>
<p>In other case it didn&rsquo;t work. So here is how to setup the wrapper manually :</p>
......@@ -136,7 +136,7 @@ Neverthless, it could be useful to check that it really worked and set the envir
<p>N.B.: to access the documentation, you need to be in the graphical interface of matlab.</p>
<p>You should rather consult the doxygen doc for the API in @CMAKE_INSTALL_PREFIX@/doc/html/index.html from your web browser.</p>
<p>You should rather consult the doxygen doc for the API in <a href="file://@CMAKE_INSTALL_PREFIX@/doc/html/index.html">@CMAKE_INSTALL_PREFIX@/doc/html/index.html</a> from your web browser.</p>
<h3>4.2 Python Wrapper</h3>
......
......@@ -50,5 +50,6 @@ The static packages for this release are:
</pre>
After installing the package, you'll need to restart your Matlab or Python session in order to take into account the new configuration of your environment.
<a name="installation"><h2> Installation on macOS </h2></a>
You can just double-click the .pkg file to launch the installation process.
Maybe you'll need to authorize a non-appstore app installation into your preferences/security parameters.
Maybe you'll need to authorize a non-appstore app installation into your preferences/security parameters.<br/>
You must respect the default path for installation otherwise the auto-setup script for environment configuration won't work.
Likewise, if Matlab has not been installed in its default path, it's most likely that the auto-setup script won't find it.
You can also proceed with the following command in a terminal:
<pre><code> $ sudo installer -pkg /path/to/faust-*.pkg -target /
</code></pre>
After installing the package, you'll need to restart your Matlab or Python session in order to take into account the new configuration of your environment.
#!/bin/bash
# find the more recent matlab version installed (sorted by year normally contained in folder name)
MATLAB_ROOT=$(find /Applications/ -iname "MATLAB*" -maxdepth 1 | tail -n 1)
if [[ ! "$?" = 0 || ! -d "${MATLAB_ROOT}" ]]
then
......
......@@ -210,6 +210,19 @@ Faust::Transform<FPP,Cpu>::Transform(const std::vector<Faust::MatGeneric<FPP,Cpu
this->check_factors_validity();
}
template<typename FPP>
Faust::Transform<FPP,Cpu>::Transform(const std::vector<Faust::MatDense<FPP,Cpu> >&facts): data(std::vector<Faust::MatGeneric<FPP,Cpu>*>()),
totalNonZeros(0)
{
data.resize(facts.size());
for (int i=0 ; i<data.size() ; i++)
{
data[i]=facts[i].Clone();
totalNonZeros += data[i]->getNonZeros();
}
}
template<typename FPP>
Faust::Transform<FPP,Cpu>::Transform(const Transform<FPP, Cpu>* A, const bool transpose_A, const bool conj_A, const Transform<FPP, Cpu>* B, const bool transpose_B, const bool conj_B):
data(std::vector<Faust::MatGeneric<FPP,Cpu>*>()), totalNonZeros(0)
......@@ -910,7 +923,7 @@ std::string Faust::Transform<FPP,Cpu>::to_string(const bool transpose /* default
str << this->getNbCol() << "x" << this->getNbRow();
else
str << this->getNbRow()<<"x"<<this->getNbCol();
str <<", density "<<1.0/getRCG()<< ", nnz_sum "<<this->get_total_nnz() << ", " << size() << " factors: "<< std::endl;
str <<", density "<<1.0/getRCG()<< ", nnz_sum "<<this->get_total_nnz() << ", " << size() << " factor(s): "<< std::endl;
int j;
for (int i=0 ; i<size() ; i++)
{
......
......@@ -336,7 +336,7 @@ classdef Faust
%> % in a matlab terminal
%> >> import matfaust.Faust
%> >> F = Faust.rand(5, 10^6, 10^-5, 'sparse')
%> Faust size 1000000x1000000, density 5e-05, nnz_sum 49999995, 5 factors:
%> Faust size 1000000x1000000, density 5e-05, nnz_sum 49999995, 5 factor(s):
%> - FACTOR 0 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999
%> - FACTOR 1 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999
%> - FACTOR 2 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999
......@@ -945,12 +945,12 @@ classdef Faust
%> >>
%> >> F = Faust.rand([1, 2], [50, 100], .5)
%> >> disp(F)
%> Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factors:
%> Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factor(s):
%> - FACTOR 0 (real) SPARSE, size 98x78, density 0.395081, nnz 3020
%> - FACTOR 1 (real) SPARSE, size 78x82, density 0.390869, nnz 2500
%>
%> >> F
%> Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factors:
%> Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factor(s):
%> - FACTOR 0 (real) SPARSE, size 98x78, density 0.395081, nnz 3020
%> - FACTOR 1 (real) SPARSE, size 78x82, density 0.390869, nnz 2500
%>
......@@ -1236,7 +1236,7 @@ classdef Faust
%>
%> F =
%>
%> Faust size 10x10, density 0.99, nnz_sum 99, 2 factors:
%> Faust size 10x10, density 0.99, nnz_sum 99, 2 factor(s):
%> - FACTOR 0 (complex) SPARSE, size 10x10, density 0.4, nnz 40
%> - FACTOR 1 (complex) DENSE, size 10x10, density 0.59, nnz 59
%> @endcode
......@@ -1247,7 +1247,7 @@ classdef Faust
%>
%> G =
%>
%> Faust size 19x16, density 1.37171, nnz_sum 417, 4 factors:
%> Faust size 19x16, density 1.37171, nnz_sum 417, 4 factor(s):
%> - FACTOR 0 (real) DENSE, size 19x17, density 0.49226, nnz 159
%> - FACTOR 1 (real) DENSE, size 17x10, density 0.517647, nnz 88
%> - FACTOR 2 (real) DENSE, size 10x13, density 0.515385, nnz 67
......
......@@ -195,11 +195,11 @@ class Faust:
>>> F = Faust.rand(2, 10, .5, is_real=False)
>>> G = Faust.rand([2, 5], [10, 20], .5, fac_type="dense")
>>> F
Faust size 10x10, density 0.99, nnz_sum 99, 2 factors:<br/>
Faust size 10x10, density 0.99, nnz_sum 99, 2 factor(s):<br/>
FACTOR 0 (complex) SPARSE, size 10x10, density 0.4, nnz 40<br/>
FACTOR 1 (complex) DENSE, size 10x10, density 0.59, nnz 59<br/>
>>> G
Faust size 19x16, density 1.37171, nnz_sum 417, 4 factors:<br/>
Faust size 19x16, density 1.37171, nnz_sum 417, 4 factor(s):<br/>
FACTOR 0 (real) DENSE, size 19x17, density 0.49226, nnz 159<br/>
FACTOR 1 (real) DENSE, size 17x10, density 0.517647, nnz 88<br/>
FACTOR 2 (real) DENSE, size 10x13, density 0.515385, nnz 67<br/>
......@@ -457,12 +457,12 @@ class Faust:
>>> from pyfaust import Faust
>>> F = Faust.rand([1, 2], [50, 100], .5)
>>> F.display()
Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factors:<br/>
Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factor(s):<br/>
FACTOR 0 (real) SPARSE, size 98x78, density 0.395081, nnz 3020<br/>
FACTOR 1 (real) SPARSE, size 78x82, density 0.390869, nnz 2500<br/>
>>> F
Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factors:<br/>
Faust size 98x82, density 0.686909, nnz_sum 5520, 2 factor(s):<br/>
FACTOR 0 (real) SPARSE, size 98x78, density 0.395081, nnz 3020<br/>
FACTOR 1 (real) SPARSE, size 78x82, density 0.390869, nnz 2500<br/>
<!-- >>> -->
......@@ -544,7 +544,7 @@ class Faust:
Examples:
>>> from pyfaust import Faust
>>> F = Faust.rand(5, 10**6, .00001, 'sparse')
Faust size 1000000x1000000, density 5e-05, nnz_sum 49999995, 5 factors:<br/>
Faust size 1000000x1000000, density 5e-05, nnz_sum 49999995, 5 factor(s):<br/>
FACTOR 0 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999<br/>
FACTOR 1 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999<br/>
FACTOR 2 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999<br/>
......@@ -582,7 +582,7 @@ class Faust:
>>> from pyfaust import Faust
>>> F = Faust.rand(5, 10**6, .00001, 'sparse')
>>> F
Faust size 1000000x1000000, density 5e-05, nnz_sum 49999995, 5 factors:<br/>
Faust size 1000000x1000000, density 5e-05, nnz_sum 49999995, 5 factor(s):<br/>
FACTOR 0 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999<br/>
FACTOR 1 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999<br/>
FACTOR 2 (real) SPARSE, size 1000000x1000000, density 1e-05, nnz 9999999<br/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment