Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
4f8a9397
Commit
4f8a9397
authored
Jan 11, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clarified example
parent
627a5c4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
matrix_ex.cpp
examples/matrix_ex.cpp
+9
-9
No files found.
examples/matrix_ex.cpp
View file @
4f8a9397
...
...
@@ -43,19 +43,19 @@ int main()
// You may be wondering why someone would want to specify the size of a
// matrix at compile time when you don't have to. The reason is two fold.
// First, there is often a substantial performance improvement, especially
// for small matrices, because
the compiler is able to perform loop
//
unrolling if it knows the sizes of matrices. Second, the dlib::matrix
//
object checks these compile time sizes to ensure that the matrices are
//
being used correctly. For example, if you attempt to compile the
//
expression y*y you will get a compiler error since that is not a legal
// matrix
operation (the matrix dimensions don't make sense as a matrix
//
multiplication). So if you know the size of a matrix at compile time
//
then it is always a good
idea to let the compiler know about it.
// for small matrices, because
it enables a number of optimizations that
//
otherwise would be impossible. Second, the dlib::matrix object checks
//
these compile time sizes to ensure that the matrices are being used
//
correctly. For example, if you attempt to compile the expression y*y you
//
will get a compiler error since that is not a legal matrix operation (the
// matrix
dimensions don't make sense as a matrix multiplication). So if
//
you know the size of a matrix at compile time then it is always a good
// idea to let the compiler know about it.
//
n
ow we need to initialize the y and M matrices and we can do so like this:
//
N
ow we need to initialize the y and M matrices and we can do so like this:
M
=
54.2
,
7.4
,
12.1
,
1
,
2
,
3
,
5.9
,
0.05
,
1
;
...
...
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