Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
9926bc92
Commit
9926bc92
authored
May 02, 2012
by
Davis King
Browse files
Added missing requirement to the dot() function for matrices.
parent
8dec52ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
dlib/matrix/matrix_utilities.h
dlib/matrix/matrix_utilities.h
+3
-2
dlib/matrix/matrix_utilities_abstract.h
dlib/matrix/matrix_utilities_abstract.h
+1
-0
No files found.
dlib/matrix/matrix_utilities.h
View file @
9926bc92
...
...
@@ -577,9 +577,10 @@ namespace dlib
COMPILE_TIME_ASSERT
(
EXP1
::
NR
*
EXP1
::
NC
==
0
||
EXP2
::
NR
*
EXP2
::
NC
==
0
);
DLIB_ASSERT
(
is_vector
(
m1
)
&&
is_vector
(
m2
)
&&
m1
.
size
()
==
m2
.
size
(),
DLIB_ASSERT
(
is_vector
(
m1
)
&&
is_vector
(
m2
)
&&
m1
.
size
()
==
m2
.
size
()
&&
m1
.
size
()
>
0
,
"
\t
type dot(const matrix_exp& m1, const matrix_exp& m2)"
<<
"
\n\t
You can only compute the dot product between vectors of equal length"
<<
"
\n\t
You can only compute the dot product between
non-empty
vectors of equal length
.
"
<<
"
\n\t
is_vector(m1): "
<<
is_vector
(
m1
)
<<
"
\n\t
is_vector(m2): "
<<
is_vector
(
m2
)
<<
"
\n\t
m1.size(): "
<<
m1
.
size
()
...
...
dlib/matrix/matrix_utilities_abstract.h
View file @
9926bc92
...
...
@@ -93,6 +93,7 @@ namespace dlib
- is_vector(m1) == true
- is_vector(m2) == true
- m1.size() == m2.size()
- m1.size() > 0
ensures
- returns the dot product between m1 and m2. That is, this function
computes and returns the sum, for all i, of m1(i)*m2(i).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment