Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
324157bb
Commit
324157bb
authored
13 years ago
by
Éric Béchet
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
637a4223
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Numeric/fullMatrix.h
+13
-13
13 additions, 13 deletions
Numeric/fullMatrix.h
with
13 additions
and
13 deletions
Numeric/fullMatrix.h
+
13
−
13
View file @
324157bb
...
@@ -29,7 +29,7 @@ class fullVector
...
@@ -29,7 +29,7 @@ class fullVector
fullVector
(
int
r
)
:
_r
(
r
),
_own_data
(
1
)
fullVector
(
int
r
)
:
_r
(
r
),
_own_data
(
1
)
{
{
_data
=
new
scalar
[
_r
];
_data
=
new
scalar
[
_r
];
setAll
(
0.
);
setAll
(
scalar
(
0.
)
)
;
}
}
fullVector
(
const
fullVector
<
scalar
>
&
other
)
:
_r
(
other
.
_r
),
_own_data
(
1
)
fullVector
(
const
fullVector
<
scalar
>
&
other
)
:
_r
(
other
.
_r
),
_own_data
(
1
)
{
{
...
@@ -84,12 +84,12 @@ class fullVector
...
@@ -84,12 +84,12 @@ class fullVector
_data
=
new
scalar
[
_r
];
_data
=
new
scalar
[
_r
];
_own_data
=
true
;
_own_data
=
true
;
if
(
resetValue
)
if
(
resetValue
)
setAll
(
scalar
());
setAll
(
scalar
(
0.
));
return
true
;
return
true
;
}
}
_r
=
r
;
_r
=
r
;
if
(
resetValue
)
if
(
resetValue
)
setAll
(
scalar
());
setAll
(
scalar
(
0.
));
return
false
;
return
false
;
}
}
void
setAsProxy
(
const
fullVector
<
scalar
>
&
original
,
int
r_start
,
int
r
)
void
setAsProxy
(
const
fullVector
<
scalar
>
&
original
,
int
r_start
,
int
r
)
...
@@ -108,8 +108,8 @@ class fullVector
...
@@ -108,8 +108,8 @@ class fullVector
}
}
inline
void
scale
(
const
scalar
s
)
inline
void
scale
(
const
scalar
s
)
{
{
if
(
s
==
0.
)
if
(
s
==
scalar
(
0.
)
)
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
_data
[
i
]
=
0.
;
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
_data
[
i
]
=
scalar
(
0.
)
;
else
if
(
s
==
-
1.
)
else
if
(
s
==
-
1.
)
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
_data
[
i
]
=
-
_data
[
i
];
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
_data
[
i
]
=
-
_data
[
i
];
else
else
...
@@ -191,12 +191,12 @@ class fullMatrix
...
@@ -191,12 +191,12 @@ class fullMatrix
{
{
_data
=
new
scalar
[
_r
*
_c
];
_data
=
new
scalar
[
_r
*
_c
];
_own_data
=
true
;
_own_data
=
true
;
setAll
(
0.
);
setAll
(
scalar
(
0.
)
)
;
}
}
fullMatrix
(
int
r
,
int
c
,
double
*
data
)
fullMatrix
(
int
r
,
int
c
,
double
*
data
)
:
_r
(
r
),
_c
(
c
),
_data
(
data
),
_own_data
(
false
)
:
_r
(
r
),
_c
(
c
),
_data
(
data
),
_own_data
(
false
)
{
{
setAll
(
0.
);
setAll
(
scalar
(
0.
)
)
;
}
}
fullMatrix
(
const
fullMatrix
<
scalar
>
&
other
)
:
_r
(
other
.
_r
),
_c
(
other
.
_c
)
fullMatrix
(
const
fullMatrix
<
scalar
>
&
other
)
:
_r
(
other
.
_r
),
_c
(
other
.
_c
)
{
{
...
@@ -249,13 +249,13 @@ class fullMatrix
...
@@ -249,13 +249,13 @@ class fullMatrix
_data
=
new
scalar
[
_r
*
_c
];
_data
=
new
scalar
[
_r
*
_c
];
_own_data
=
true
;
_own_data
=
true
;
if
(
resetValue
)
if
(
resetValue
)
setAll
(
0.
);
setAll
(
scalar
(
0.
)
)
;
return
true
;
return
true
;
}
}
_r
=
r
;
_r
=
r
;
_c
=
c
;
_c
=
c
;
if
(
resetValue
)
if
(
resetValue
)
setAll
(
0.
);
setAll
(
scalar
(
0.
)
)
;
return
false
;
// no reallocation
return
false
;
// no reallocation
}
}
void
setAsProxy
(
const
fullMatrix
<
scalar
>
&
original
)
void
setAsProxy
(
const
fullMatrix
<
scalar
>
&
original
)
...
@@ -328,7 +328,7 @@ class fullMatrix
...
@@ -328,7 +328,7 @@ class fullMatrix
}
}
void
mult_naive
(
const
fullMatrix
<
scalar
>
&
b
,
fullMatrix
<
scalar
>
&
c
)
const
void
mult_naive
(
const
fullMatrix
<
scalar
>
&
b
,
fullMatrix
<
scalar
>
&
c
)
const
{
{
c
.
scale
(
0.
);
c
.
scale
(
scalar
(
0.
)
)
;
for
(
int
i
=
0
;
i
<
_r
;
i
++
)
for
(
int
i
=
0
;
i
<
_r
;
i
++
)
for
(
int
j
=
0
;
j
<
b
.
size2
();
j
++
)
for
(
int
j
=
0
;
j
<
b
.
size2
();
j
++
)
for
(
int
k
=
0
;
k
<
_c
;
k
++
)
for
(
int
k
=
0
;
k
<
_c
;
k
++
)
...
@@ -384,7 +384,7 @@ class fullMatrix
...
@@ -384,7 +384,7 @@ class fullMatrix
#if !defined(HAVE_BLAS)
#if !defined(HAVE_BLAS)
{
{
if
(
s
==
0.
)
// this is not really correct nan*0 (or inf*0) is expected to give nan
if
(
s
==
0.
)
// this is not really correct nan*0 (or inf*0) is expected to give nan
for
(
int
i
=
0
;
i
<
_r
*
_c
;
++
i
)
_data
[
i
]
=
0.
;
for
(
int
i
=
0
;
i
<
_r
*
_c
;
++
i
)
_data
[
i
]
=
scalar
(
0.
)
;
else
else
for
(
int
i
=
0
;
i
<
_r
*
_c
;
++
i
)
_data
[
i
]
*=
s
;
for
(
int
i
=
0
;
i
<
_r
*
_c
;
++
i
)
_data
[
i
]
*=
s
;
}
}
...
@@ -409,7 +409,7 @@ class fullMatrix
...
@@ -409,7 +409,7 @@ class fullMatrix
void
mult
(
const
fullVector
<
scalar
>
&
x
,
fullVector
<
scalar
>
&
y
)
const
void
mult
(
const
fullVector
<
scalar
>
&
x
,
fullVector
<
scalar
>
&
y
)
const
#if !defined(HAVE_BLAS)
#if !defined(HAVE_BLAS)
{
{
y
.
scale
(
0.
);
y
.
scale
(
scalar
(
0.
)
)
;
for
(
int
i
=
0
;
i
<
_r
;
i
++
)
for
(
int
i
=
0
;
i
<
_r
;
i
++
)
for
(
int
j
=
0
;
j
<
_c
;
j
++
)
for
(
int
j
=
0
;
j
<
_c
;
j
++
)
y
.
_data
[
i
]
+=
(
*
this
)(
i
,
j
)
*
x
(
j
);
y
.
_data
[
i
]
+=
(
*
this
)(
i
,
j
)
*
x
(
j
);
...
@@ -495,7 +495,7 @@ class fullMatrix
...
@@ -495,7 +495,7 @@ class fullMatrix
#if !defined(HAVE_LAPACK)
#if !defined(HAVE_LAPACK)
{
{
Msg
::
Error
(
"Determinant computation requires LAPACK"
);
Msg
::
Error
(
"Determinant computation requires LAPACK"
);
return
0.
;
return
scalar
(
0.
)
;
}
}
#endif
#endif
;
;
...
...
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