mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
update solve function
This commit is contained in:
parent
325d43eed1
commit
7d145d4dc7
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@ -31,6 +31,11 @@
|
|||||||
<option name="name" value="Maven Central repository" />
|
<option name="name" value="Maven Central repository" />
|
||||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
<remote-repository>
|
<remote-repository>
|
||||||
<option name="id" value="jboss.community" />
|
<option name="id" value="jboss.community" />
|
||||||
<option name="name" value="JBoss Community repository" />
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
|||||||
@ -1,34 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\map\topology">
|
<Path OpenPath="D:\Working\MIScript\Jython\mis\common_math\linalg">
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\wrf"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\data_process"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataset"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\legend"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\hdf"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\grib"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\grib"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\scatter"/>
|
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\wind"/>
|
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\axis"/>
|
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
||||||
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\interpolate"/>
|
||||||
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\fitting"/>
|
||||||
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\grads"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataframe"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
|
||||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\topology"/>
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math"/>
|
||||||
|
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\linalg"/>
|
||||||
</Path>
|
</Path>
|
||||||
<File>
|
<File>
|
||||||
<OpenedFiles>
|
<OpenedFiles>
|
||||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\model_selection\train_test_split_2.py"/>
|
<OpenedFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\model_selection\train_test_split_2.py"/>
|
||||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\deep_learning\mnist_1.py"/>
|
<OpenedFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\deep_learning\mnist_1.py"/>
|
||||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\map\projection\ortho_proj.py"/>
|
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot_cuace_3d_particles_relief.py"/>
|
||||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\map\topology\symdiff.py"/>
|
<OpenedFile File="D:\Working\MIScript\Jython\mis\common_math\linalg\solve_1.py"/>
|
||||||
</OpenedFiles>
|
</OpenedFiles>
|
||||||
<RecentFiles>
|
<RecentFiles>
|
||||||
<RecentFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\model_selection\train_test_split_2.py"/>
|
<RecentFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\model_selection\train_test_split_2.py"/>
|
||||||
<RecentFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\deep_learning\mnist_1.py"/>
|
<RecentFile File="D:\Working\MIScript\Jython\mis\toolbox\miml\deep_learning\mnist_1.py"/>
|
||||||
<RecentFile File="D:\Working\MIScript\Jython\mis\map\projection\ortho_proj.py"/>
|
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot_cuace_3d_particles_relief.py"/>
|
||||||
<RecentFile File="D:\Working\MIScript\Jython\mis\map\topology\symdiff.py"/>
|
<RecentFile File="D:\Working\MIScript\Jython\mis\common_math\linalg\solve_1.py"/>
|
||||||
</RecentFiles>
|
</RecentFiles>
|
||||||
</File>
|
</File>
|
||||||
<Font>
|
<Font>
|
||||||
@ -36,5 +36,5 @@
|
|||||||
</Font>
|
</Font>
|
||||||
<LookFeel Name="FlatDarkLaf"/>
|
<LookFeel Name="FlatDarkLaf"/>
|
||||||
<Figure DoubleBuffering="true"/>
|
<Figure DoubleBuffering="true"/>
|
||||||
<Startup MainFormLocation="-7,0" MainFormSize="1340,763"/>
|
<Startup MainFormLocation="-7,-7" MainFormSize="1293,693"/>
|
||||||
</MeteoInfo>
|
</MeteoInfo>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.meteothink</groupId>
|
<groupId>org.meteothink</groupId>
|
||||||
<artifactId>MeteoInfo</artifactId>
|
<artifactId>MeteoInfo</artifactId>
|
||||||
<version>2.2.7</version>
|
<version>2.2.8</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>MeteoInfoLab</artifactId>
|
<artifactId>MeteoInfoLab</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|||||||
Binary file not shown.
@ -15,6 +15,22 @@ __all__ = [
|
|||||||
'solve','cholesky','det','lu','qr', 'svd','eig','inv','lstsq','solve_triangular'
|
'solve','cholesky','det','lu','qr', 'svd','eig','inv','lstsq','solve_triangular'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
class LinAlgError(Exception):
|
||||||
|
"""
|
||||||
|
Generic Python-exception-derived object raised by linalg functions.
|
||||||
|
General purpose exception class, derived from Python's exception.Exception
|
||||||
|
class, programmatically raised in linalg functions when a Linear
|
||||||
|
Algebra-related condition would prevent further correct execution of the
|
||||||
|
function.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _assert_2d(*arrays):
|
||||||
|
for a in arrays:
|
||||||
|
if a.ndim != 2:
|
||||||
|
raise LinAlgError('%d-dimensional array given. Array must be '
|
||||||
|
'two-dimensional' % a.ndim)
|
||||||
|
|
||||||
def solve(a, b):
|
def solve(a, b):
|
||||||
'''
|
'''
|
||||||
Solve a linear matrix equation, or system of linear scalar equations.
|
Solve a linear matrix equation, or system of linear scalar equations.
|
||||||
@ -34,8 +50,16 @@ def solve(a, b):
|
|||||||
x : {(M), (M, K)} ndarray
|
x : {(M), (M, K)} ndarray
|
||||||
Solution to the system a x = b. Returned shape is identical to ``b``.
|
Solution to the system a x = b. Returned shape is identical to ``b``.
|
||||||
'''
|
'''
|
||||||
|
_assert_2d(a)
|
||||||
|
r_2d = False
|
||||||
|
if b.ndim == 2:
|
||||||
|
b = b.flatten()
|
||||||
|
r_2d = True
|
||||||
x = LinalgUtil.solve(a.asarray(), b.asarray())
|
x = LinalgUtil.solve(a.asarray(), b.asarray())
|
||||||
return NDArray(x)
|
r = NDArray(x)
|
||||||
|
if r_2d:
|
||||||
|
r = r.reshape((len(r),1))
|
||||||
|
return r
|
||||||
|
|
||||||
def solve_triangular(a, b, lower=False):
|
def solve_triangular(a, b, lower=False):
|
||||||
'''
|
'''
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.meteothink</groupId>
|
<groupId>org.meteothink</groupId>
|
||||||
<artifactId>MeteoInfo</artifactId>
|
<artifactId>MeteoInfo</artifactId>
|
||||||
<version>2.2.7</version>
|
<version>2.2.8</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>MeteoInfoLib</artifactId>
|
<artifactId>MeteoInfoLib</artifactId>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<repository>
|
<repository>
|
||||||
<id>central</id>
|
<id>central</id>
|
||||||
<name>Maven Central</name>
|
<name>Maven Central</name>
|
||||||
<url>http://repo1.maven.org/maven2/</url>
|
<url>https://repo1.maven.org/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>unidata-all</id>
|
<id>unidata-all</id>
|
||||||
|
|||||||
@ -63,7 +63,7 @@ public class GlobalUtil {
|
|||||||
* @return Software version
|
* @return Software version
|
||||||
*/
|
*/
|
||||||
public static String getVersion(){
|
public static String getVersion(){
|
||||||
return "2.2.7";
|
return "2.2.8";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.meteothink</groupId>
|
<groupId>org.meteothink</groupId>
|
||||||
<artifactId>MeteoInfo</artifactId>
|
<artifactId>MeteoInfo</artifactId>
|
||||||
<version>2.2.7</version>
|
<version>2.2.8</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>MeteoInfoMap</artifactId>
|
<artifactId>MeteoInfoMap</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.meteothink</groupId>
|
<groupId>org.meteothink</groupId>
|
||||||
<artifactId>MeteoInfo</artifactId>
|
<artifactId>MeteoInfo</artifactId>
|
||||||
<version>2.2.7</version>
|
<version>2.2.8</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user