Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MES_Wind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Debolskiy Andrey
MES_Wind
Commits
c5d5ac90
Commit
c5d5ac90
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Patches
Plain Diff
generic matrix created.
parent
7a72d260
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
WindStressPRM/Matrix.cs
+74
-0
74 additions, 0 deletions
WindStressPRM/Matrix.cs
WindStressPRM/WindStressPRM.cs
+0
-37
0 additions, 37 deletions
WindStressPRM/WindStressPRM.cs
with
74 additions
and
37 deletions
WindStressPRM/Matrix.cs
0 → 100644
+
74
−
0
View file @
c5d5ac90
using
System
;
using
System.Collections.Generic
;
namespace
WindStressPRM
{
/// <summary>
/// Generic Matrix of type T
/// </summary>
/// <typeparam name="T"></typeparam>
public
class
Matrix
<
T
>
{
/// <summary>
/// Size of cell. In meters
/// </summary>
public
CellSize
Size
{
get
;
set
;
}
/// <summary>
/// Cells Container
/// </summary>
public
T
[,]
Cells
{
get
;
set
;
}
/// <summary>
/// Number of rows in matrix
/// </summary>
/// <returns></returns>
public
int
RowsCount
()
{
return
Cells
.
Rank
>
0
?
Cells
.
GetLength
(
0
)
:
0
;
}
/// <summary>
/// Number of columns
/// </summary>
/// <returns></returns>
public
int
ColumnCount
()
{
return
Cells
.
Rank
>
1
?
Cells
.
GetLength
(
1
)
:
0
;
}
}
/// <summary>
/// Cell Sizes
/// Параметры ячейки (регулярной сетки)
/// </summary>
public
class
CellSize
{
/// <summary>
/// ширина ячейки (расстояние между соседними по широте центрами ячеек)
/// </summary>
public
double
Width
{
get
;
set
;
}
/// <summary>
/// высота ячейки (расстояние между соседними по долготе центрами ячеек)
/// </summary>
public
double
Height
{
get
;
set
;
}
/// <summary>
/// designated constructor
/// </summary>
/// <param name="wdh">Cell Width</param>
/// <param name="hgh">Cell Height</param>
public
CellSize
(
double
wdh
,
double
hgh
)
{
this
.
Width
=
wdh
;
this
.
Height
=
hgh
;
if
(!(
this
.
CheckValue
()))
{
throw
new
System
.
ArgumentException
(
"Cell width or height values are incorrect!"
);
}
}
/// <summary>
/// Проверка валидности полей
/// </summary>
/// <returns></returns>
public
bool
CheckValue
()
{
return
Width
>
0
&&
Height
>
0
;
}
}
}
This diff is collapsed.
Click to expand it.
WindStressPRM/WindStressPRM.cs
+
0
−
37
View file @
c5d5ac90
...
...
@@ -198,43 +198,6 @@ namespace WindStressPRM
}
}
/// <summary>
/// Cell Size parameters
/// Параметры ячейки (регулярной сетки)
/// </summary>
public
class
CellSize
{
/// <summary>
/// ширина ячейки (расстояние между соседними по широте центрами ячеек)
/// </summary>
public
double
Width
{
get
;
set
;
}
/// <summary>
/// высота ячейки (расстояние между соседними по долготе центрами ячеек)
/// </summary>
public
double
Height
{
get
;
set
;
}
/// <summary>
/// designated constructor
/// </summary>
/// <param name="wdh">Cell Width</param>
/// <param name="hgh">Cell Height</param>
public
CellSize
(
double
wdh
,
double
hgh
)
{
this
.
Width
=
wdh
;
this
.
Height
=
hgh
;
if
(!(
this
.
CheckValue
()))
{
throw
new
System
.
ArgumentException
(
"Cell width or height values are incorrect!"
);
}
}
/// <summary>
/// Проверка валидности полей
/// </summary>
/// <returns></returns>
public
bool
CheckValue
()
{
return
Width
>
0
&&
Height
>
0
;
}
}
/// <summary>
/// power line object
/// объект - ЛЭП
/// </summary>
...
...
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