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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
331345d0
Commit
331345d0
authored
14 years ago
by
Gauthier Becker
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite for more efficiency
parent
f8525ea6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/SPoint3.h
+1
-1
1 addition, 1 deletion
Geo/SPoint3.h
Numeric/fullMatrix.cpp
+61
-42
61 additions, 42 deletions
Numeric/fullMatrix.cpp
Numeric/fullMatrix.h
+32
-23
32 additions, 23 deletions
Numeric/fullMatrix.h
with
94 additions
and
66 deletions
Geo/SPoint3.h
+
1
−
1
View file @
331345d0
...
...
@@ -16,9 +16,9 @@ class SPoint3 {
SPoint3
(
double
x
,
double
y
,
double
z
)
{
P
[
0
]
=
x
;
P
[
1
]
=
y
;
P
[
2
]
=
z
;
}
SPoint3
(
const
double
*
p
)
{
P
[
0
]
=
p
[
0
];
P
[
1
]
=
p
[
1
];
P
[
2
]
=
p
[
2
];
}
SPoint3
(
const
SPoint3
&
pt
)
{
P
[
0
]
=
pt
.
P
[
0
];
P
[
1
]
=
pt
.
P
[
1
];
P
[
2
]
=
pt
.
P
[
2
];
}
SPoint3
(
const
SPoint3
&
pt
,
const
SPoint3
&
dir
,
const
double
dist_
)
{
P
[
0
]
=
pt
.
P
[
0
];
P
[
1
]
=
pt
.
P
[
1
];
P
[
2
]
=
pt
.
P
[
2
];
SPoint3
a
(
dir
);
a
*=
dist_
;
P
[
0
]
+=
a
[
0
];
P
[
1
]
+=
a
[
1
];
P
[
2
]
+=
a
[
2
];}
virtual
~
SPoint3
()
{}
void
setPosition
(
double
xx
,
double
yy
,
double
zz
);
void
setPosition
(
const
SPoint3
&
pt
,
const
SPoint3
&
dir
,
const
double
dist_
)
{
P
[
0
]
=
pt
.
P
[
0
];
P
[
1
]
=
pt
.
P
[
1
];
P
[
2
]
=
pt
.
P
[
2
];
SPoint3
a
(
dir
);
a
*=
dist_
;
P
[
0
]
+=
a
[
0
];
P
[
1
]
+=
a
[
1
];
P
[
2
]
+=
a
[
2
];}
void
getPosition
(
double
*
xx
,
double
*
yy
,
double
*
zz
)
const
;
void
position
(
double
*
)
const
;
inline
double
x
(
void
)
const
;
...
...
This diff is collapsed.
Click to expand it.
Numeric/fullMatrix.cpp
+
61
−
42
View file @
331345d0
...
...
@@ -127,6 +127,15 @@ void fullMatrix<double>::mult(const fullVector<double> &x, fullVector<double> &y
&
beta
,
y
.
_data
,
&
INCY
);
}
template
<
>
void
fullMatrix
<
double
>::
multAddy
(
const
fullVector
<
double
>
&
x
,
fullVector
<
double
>
&
y
)
const
{
int
M
=
_r
,
N
=
_c
,
LDA
=
_r
,
INCX
=
1
,
INCY
=
1
;
double
alpha
=
1.
,
beta
=
1.
;
F77NAME
(
dgemv
)(
"N"
,
&
M
,
&
N
,
&
alpha
,
_data
,
&
LDA
,
x
.
_data
,
&
INCX
,
&
beta
,
y
.
_data
,
&
INCY
);
}
template
<
>
void
fullMatrix
<
std
::
complex
<
double
>
>::
mult
(
const
fullVector
<
std
::
complex
<
double
>
>
&
x
,
fullVector
<
std
::
complex
<
double
>
>
&
y
)
const
...
...
@@ -137,6 +146,16 @@ void fullMatrix<std::complex<double> >::mult(const fullVector<std::complex<doubl
&
beta
,
y
.
_data
,
&
INCY
);
}
template
<
>
void
fullMatrix
<
std
::
complex
<
double
>
>::
multAddy
(
const
fullVector
<
std
::
complex
<
double
>
>
&
x
,
fullVector
<
std
::
complex
<
double
>
>
&
y
)
const
{
int
M
=
_r
,
N
=
_c
,
LDA
=
_r
,
INCX
=
1
,
INCY
=
1
;
std
::
complex
<
double
>
alpha
=
1.
,
beta
=
1.
;
F77NAME
(
zgemv
)(
"N"
,
&
M
,
&
N
,
&
alpha
,
_data
,
&
LDA
,
x
.
_data
,
&
INCX
,
&
beta
,
y
.
_data
,
&
INCY
);
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Numeric/fullMatrix.h
+
32
−
23
View file @
331345d0
...
...
@@ -409,6 +409,15 @@ class fullMatrix
for
(
int
j
=
0
;
j
<
_c
;
j
++
)
y
.
_data
[
i
]
+=
(
*
this
)(
i
,
j
)
*
x
(
j
);
}
#endif
;
void
multAddy
(
const
fullVector
<
scalar
>
&
x
,
fullVector
<
scalar
>
&
y
)
const
#if !defined(HAVE_BLAS)
{
for
(
int
i
=
0
;
i
<
_r
;
i
++
)
for
(
int
j
=
0
;
j
<
_c
;
j
++
)
y
.
_data
[
i
]
+=
(
*
this
)(
i
,
j
)
*
x
(
j
);
}
#endif
;
inline
fullMatrix
<
scalar
>
transpose
()
...
...
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