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
27f04a37
Commit
27f04a37
authored
Sep 26, 2015
by
Davis King
Browse files
fixed tabbing
parent
80850327
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
80 deletions
+80
-80
dlib/dnn/core.h
dlib/dnn/core.h
+14
-14
dlib/dnn/core_abstract.h
dlib/dnn/core_abstract.h
+66
-66
No files found.
dlib/dnn/core.h
View file @
27f04a37
...
@@ -51,25 +51,25 @@ namespace dlib
...
@@ -51,25 +51,25 @@ namespace dlib
template
<
typename
T
,
size_t
N
>
template
<
typename
T
,
size_t
N
>
class
sstack
class
sstack
{
{
public:
public:
static_assert
(
N
>
0
,
"You can't create an empty sstack."
);
static_assert
(
N
>
0
,
"You can't create an empty sstack."
);
typedef
T
value_type
;
typedef
T
value_type
;
const
static
size_t
num_elements
=
N
;
const
static
size_t
num_elements
=
N
;
sstack
()
{}
sstack
()
{}
sstack
(
const
T
&
item_
)
:
item
(
item_
),
data
(
item_
)
{}
sstack
(
const
T
&
item_
)
:
item
(
item_
),
data
(
item_
)
{}
const
T
&
top
()
const
{
return
item
;
}
const
T
&
top
()
const
{
return
item
;
}
T
&
top
()
{
return
item
;
}
T
&
top
()
{
return
item
;
}
size_t
size
()
const
{
return
N
;
}
size_t
size
()
const
{
return
N
;
}
const
sstack
<
T
,
N
-
1
>&
pop
()
const
{
return
data
;
}
const
sstack
<
T
,
N
-
1
>&
pop
()
const
{
return
data
;
}
sstack
<
T
,
N
-
1
>&
pop
()
{
return
data
;
}
sstack
<
T
,
N
-
1
>&
pop
()
{
return
data
;
}
private:
private:
T
item
;
T
item
;
sstack
<
T
,
N
-
1
>
data
;
sstack
<
T
,
N
-
1
>
data
;
};
};
template
<
typename
T
>
template
<
typename
T
>
...
...
dlib/dnn/core_abstract.h
View file @
27f04a37
...
@@ -52,72 +52,72 @@ namespace dlib
...
@@ -52,72 +52,72 @@ namespace dlib
entirely allocated on the stack.
entirely allocated on the stack.
!*/
!*/
public:
public:
typedef
T
value_type
;
typedef
T
value_type
;
const
static
size_t
num_elements
=
N
;
const
static
size_t
num_elements
=
N
;
sstack
(
sstack
(
);
);
/*!
/*!
ensures
ensures
- #size() == N
- #size() == N
- All elements of this stack are default constructed.
- All elements of this stack are default constructed.
!*/
!*/
sstack
(
sstack
(
const
T
&
item
const
T
&
item
);
);
/*!
/*!
ensures
ensures
- #size() == N
- #size() == N
- Initializes all N elements in this stack with the given item.
- Initializes all N elements in this stack with the given item.
E.g.
E.g.
top()==item, pop().top()==item, pop().pop().top()==item, etc.
top()==item, pop().top()==item, pop().pop().top()==item, etc.
!*/
!*/
const
T
&
top
(
const
T
&
top
(
)
const
;
)
const
;
/*!
/*!
ensures
ensures
- returns the top element of the stack.
- returns the top element of the stack.
!*/
!*/
T
&
top
(
T
&
top
(
);
);
/*!
/*!
ensures
ensures
- returns the top element of the stack.
- returns the top element of the stack.
!*/
!*/
size_t
size
(
size_t
size
(
)
const
;
)
const
;
/*!
/*!
ensures
ensures
- returns the number of elements in this stack. In particular, the
- returns the number of elements in this stack. In particular, the
number
number
returned is always N.
returned is always N.
!*/
!*/
const
sstack
<
T
,
N
-
1
>&
pop
(
const
sstack
<
T
,
N
-
1
>&
pop
(
)
const
;
)
const
;
/*!
/*!
requires
requires
- size() > 1
- size() > 1
ensures
ensures
- returns a reference to the sub-stack S such that:
- returns a reference to the sub-stack S such that:
- S.size() == size()-1.
- S.size() == size()-1.
- S.top() is the next element in the stack.
- S.top() is the next element in the stack.
!*/
!*/
sstack
<
T
,
N
-
1
>&
pop
(
sstack
<
T
,
N
-
1
>&
pop
(
);
);
/*!
/*!
requires
requires
- size() > 1
- size() > 1
ensures
ensures
- returns a reference to the sub-stack S such that:
- returns a reference to the sub-stack S such that:
- S.size() == size()-1.
- S.size() == size()-1.
- S.top() is the next element in the stack.
- S.top() is the next element in the stack.
!*/
!*/
};
};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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