Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
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
Container Registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
miscmaths
Commits
2291a504
Commit
2291a504
authored
6 years ago
by
Jesper Andersson
Browse files
Options
Downloads
Patches
Plain Diff
Added << operator
parent
45904440
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
Simplex.h
+11
-14
11 additions, 14 deletions
Simplex.h
with
11 additions
and
14 deletions
Simplex.h
+
11
−
14
View file @
2291a504
...
...
@@ -74,8 +74,18 @@ public:
void
MultiContract
();
/// Update the indicies for best, worst and 2nd to worst points.
void
UpdateRankIndicies
();
// Prints out the points of the simplex and the associated function values
//
Global function.
Prints out the points of the simplex and the associated function values
friend
ostream
&
operator
<<
(
ostream
&
op
,
const
Simplex
&
smplx
);
{
op
<<
"Simplex = "
<<
endl
;
for
(
unsigned
int
i
=
0
;
i
<
smplx
.
_smx
.
size
();
i
++
)
{
for
(
unsigned
int
j
=
1
;
j
<
smplx
.
_smx
.
size
();
j
++
)
{
op
<<
std
::
setw
(
10
)
<<
std
::
setprecision
(
4
)
<<
smplx
.
_smx
[
i
](
j
);
}
op
<<
" | "
<<
std
::
setw
(
10
)
<<
std
::
setprecision
(
4
)
<<
smplx
.
_fv
[
i
]
<<
endl
;
}
return
(
op
);
}
private
:
const
MISCMATHS
::
NonlinCF
&
_cf
;
const
NEWMAT
::
ColumnVector
_sp
;
...
...
@@ -90,19 +100,6 @@ private:
void
calculate_reflexion_point
(
unsigned
int
ii
);
};
// Global function, friend of Simplex
ostream
&
operator
<<
(
ostream
&
op
,
const
Simplex
&
smplx
)
{
op
<<
"Simplex = "
<<
endl
;
for
(
unsigned
int
i
=
0
;
i
<
smplx
.
_smx
.
size
();
i
++
)
{
for
(
unsigned
int
j
=
1
;
j
<
smplx
.
_smx
.
size
();
j
++
)
{
op
<<
std
::
setw
(
10
)
<<
std
::
setprecision
(
4
)
<<
smplx
.
_smx
[
i
](
j
);
}
op
<<
" | "
<<
std
::
setw
(
10
)
<<
std
::
setprecision
(
4
)
<<
smplx
.
_fv
[
i
]
<<
endl
;
}
return
(
op
);
}
}
// End namespace MISCMATHS
#endif // End #ifndef Simplex_h
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