-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from HamletTanyavong/dev
Add rank one and two tensors
- Loading branch information
Showing
39 changed files
with
1,263 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Tensors | ||
|
||
[work in progress] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Mathematics.NET Articles | ||
|
||
Welcome to Mathematics.NET. | ||
This section is dedicated to highlighting areas of math covered in this library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
- name: Introduction | ||
href: intro.md | ||
- name: Get Started | ||
- name: Differential Geometry | ||
items: | ||
- name: Installation | ||
href: get_started/installation.md | ||
- name: Fundamentals | ||
items: | ||
- name: Numeric Types | ||
href: fundamentals/numeric-types.md | ||
- name: Tensors | ||
href: differential_geometry/tensors.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Mathematics.NET Guide | ||
|
||
Welcome to Mathematics.NET. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- name: Introduction | ||
href: intro.md | ||
- name: Get Started | ||
items: | ||
- name: Installation | ||
href: get_started/installation.md | ||
- name: Fundamentals | ||
items: | ||
- name: Numeric Types | ||
href: fundamentals/numeric-types.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
:root, [data-bs-theme="dark"] { | ||
--bg-color-primary: #161616; | ||
--bg-color-secondary: #082424; | ||
} | ||
|
||
[data-bs-theme="light"] { | ||
--bg-color-primary: #e4e4e4; | ||
--bg-color-secondary: #b4f8f8; | ||
} | ||
|
||
header { | ||
--bs-border-width: 0px; | ||
} | ||
|
||
body { | ||
background-color: var(--bg-color-primary); | ||
} | ||
|
||
body > footer { | ||
display: flex; | ||
align-items: center; | ||
padding: 0rem; | ||
height: 3rem; | ||
} | ||
|
||
footer { | ||
background-color: var(--bg-color-secondary); | ||
font-size: 0.75rem; | ||
} | ||
|
||
footer.border-top{ | ||
border-top: 0px; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.bg-body { | ||
background-color: var(--bg-color-secondary); | ||
} | ||
|
||
.dropdown a:hover { | ||
text-decoration: none; | ||
} | ||
|
||
.dropdown-menu[data-bs-popper] { | ||
background-color: var(--bg-color-secondary); | ||
margin-top: 1.125rem; | ||
} | ||
|
||
.dropdown-menu a:hover { | ||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
defaultTheme: 'dark', | ||
iconLinks: [ | ||
{ | ||
icon: 'github', | ||
href: 'https://github.com/HamletTanyavong/Mathematics.NET', | ||
title: 'GitHub' | ||
}, | ||
{ | ||
icon: 'heart', | ||
href: 'https://github.com/sponsors/HamletTanyavong', | ||
title: 'Sponsor' | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
- name: Guide | ||
href: guide/ | ||
- name: API | ||
href: api/ | ||
- name: Articles | ||
href: articles/ | ||
- name: Api Documentation | ||
href: api/ | ||
homepage: api/index.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Mathematics.NET/DifferentialGeometry/Abstractions/IIndex.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// <copyright file="IIndex.cs" company="Mathematics.NET"> | ||
// Mathematics.NET | ||
// https://github.com/HamletTanyavong/Mathematics.NET | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2023 Hamlet Tanyavong | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// </copyright> | ||
|
||
namespace Mathematics.NET.DifferentialGeometry.Abstractions; | ||
|
||
/// <summary>Defines support for tensor indices</summary> | ||
public interface IIndex : IFormattable | ||
{ | ||
/// <summary>Gets an instance of this struct</summary> | ||
static abstract IIndex Instance { get; } | ||
} |
35 changes: 35 additions & 0 deletions
35
src/Mathematics.NET/DifferentialGeometry/Abstractions/IIndexPosition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// <copyright file="IIndexPosition.cs" company="Mathematics.NET"> | ||
// Mathematics.NET | ||
// https://github.com/HamletTanyavong/Mathematics.NET | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2023 Hamlet Tanyavong | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// </copyright> | ||
|
||
namespace Mathematics.NET.DifferentialGeometry.Abstractions; | ||
|
||
/// <summary>Represents an index position</summary> | ||
public interface IIndexPosition | ||
{ | ||
/// <summary>Get a string representation of the index position</summary> | ||
static abstract string DisplayString { get; } | ||
} |
49 changes: 49 additions & 0 deletions
49
src/Mathematics.NET/DifferentialGeometry/Abstractions/IRankOneTensor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// <copyright file="IRankOneTensor.cs" company="Mathematics.NET"> | ||
// Mathematics.NET | ||
// https://github.com/HamletTanyavong/Mathematics.NET | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2023 Hamlet Tanyavong | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// </copyright> | ||
|
||
using Mathematics.NET.LinearAlgebra.Abstractions; | ||
|
||
namespace Mathematics.NET.DifferentialGeometry.Abstractions; | ||
|
||
/// <summary>Defines support for rank-one tensors</summary> | ||
/// <typeparam name="T">The type that implements the interface</typeparam> | ||
/// <typeparam name="U">A backing type that implements <see cref="IVector{T, U}"/></typeparam> | ||
/// <typeparam name="V">A type that implements <see cref="IComplex{T}"/></typeparam> | ||
/// <typeparam name="W">An index</typeparam> | ||
public interface IRankOneTensor<T, U, V, W> : IOneDimensionalArrayRepresentable<T, V> | ||
where T : IRankOneTensor<T, U, V, W> | ||
where U : IVector<U, V> | ||
where V : IComplex<V> | ||
where W : IIndex | ||
{ | ||
/// <summary>Get the index associated with this rank one tensor</summary> | ||
IIndex Index { get; } | ||
|
||
/// <summary>Convert a value that implements <see cref="IVector{T, U}"/> to one of type <typeparamref name="T"/></summary> | ||
/// <param name="input">The value to convert</param> | ||
static abstract implicit operator T(U input); | ||
} |
51 changes: 51 additions & 0 deletions
51
src/Mathematics.NET/DifferentialGeometry/Abstractions/IRankTwoTensor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// <copyright file="IRankTwoTensor.cs" company="Mathematics.NET"> | ||
// Mathematics.NET | ||
// https://github.com/HamletTanyavong/Mathematics.NET | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2023 Hamlet Tanyavong | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// </copyright> | ||
|
||
using Mathematics.NET.LinearAlgebra.Abstractions; | ||
|
||
namespace Mathematics.NET.DifferentialGeometry.Abstractions; | ||
|
||
/// <summary>Defines support for rank-two tensors</summary> | ||
/// <typeparam name="T">The type that implements the interface</typeparam> | ||
/// <typeparam name="U">A backing type that implements <see cref="ISquareMatrix{T, U}"/></typeparam> | ||
/// <typeparam name="V">A type that implements <see cref="IComplex{T}"/></typeparam> | ||
/// <typeparam name="W">An index</typeparam> | ||
/// <typeparam name="X">An index</typeparam> | ||
public interface IRankTwoTensor<T, U, V, W, X> : ITwoDimensionalArrayRepresentable<T, V> | ||
where T : IRankTwoTensor<T, U, V, W, X> | ||
where U : ISquareMatrix<U, V> | ||
where V : IComplex<V> | ||
where W : IIndex | ||
where X : IIndex | ||
{ | ||
/// <summary>Get the indices associated with this rank two tensor</summary> | ||
IIndex[] Indices { get; } | ||
|
||
/// <summary>Convert a value that implements <see cref="IMatrix{T, U}"/> to one of type <typeparamref name="T"/></summary> | ||
/// <param name="input">The value to convert</param> | ||
static abstract implicit operator T(U input); | ||
} |
Oops, something went wrong.