v2.2.0: Clean .NET solution architecture, remove legacy Unity artifacts and restructure project
This commit is contained in:
parent
6a49fd2c31
commit
9431d1c430
117 changed files with 93 additions and 16582 deletions
65
.gitignore
vendored
65
.gitignore
vendored
|
|
@ -1,50 +1,23 @@
|
|||
# Unity default ignore files
|
||||
/[Ll]ibrary/
|
||||
/[Tt]emp/
|
||||
/[Oo]bj/
|
||||
/[Bb]uild/
|
||||
/[Bb]uilds/
|
||||
/[Ll]ogs/
|
||||
/[Mm]emoryCaptures/
|
||||
/[Aa]rchive/
|
||||
|
||||
# Asset meta files for folders ignored above
|
||||
/[Ll]ibrary.meta
|
||||
/[Tt]emp.meta
|
||||
/[Oo]bj.meta
|
||||
/[Bb]uild.meta
|
||||
/[Bb]uilds.meta
|
||||
/[Ss]ave.meta
|
||||
|
||||
# Autogenerated VS/MD/Consulo solution and project files
|
||||
ExportedObj/
|
||||
.consulo/
|
||||
/*.csproj
|
||||
/*.unityproj
|
||||
/*.sln
|
||||
*.suo
|
||||
*.tmp
|
||||
*.user
|
||||
*.userprefs
|
||||
*.pidb
|
||||
*.booproj
|
||||
*.svd
|
||||
*.pdb
|
||||
*.opendb
|
||||
*.tlog
|
||||
|
||||
# .NET build artifacts
|
||||
## Build and output results
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Unity3D generated meta files
|
||||
sysinfo.txt
|
||||
|
||||
# Builds and big binaries (GitHub has a 100MB limit per file, so we must exclude these)
|
||||
*.exe
|
||||
*.zip
|
||||
*.apk
|
||||
*.unitypackage
|
||||
*.app
|
||||
## Visual Studio cache and settings
|
||||
.vs/
|
||||
[Rr]elease/
|
||||
*.user
|
||||
*.userprefs
|
||||
*.suo
|
||||
*.ide/
|
||||
|
||||
## Test results
|
||||
[Tt]est[Rr]esult*/
|
||||
|
||||
## Release artifacts directory (contain large binaries)
|
||||
Release/
|
||||
|
||||
## Temporary and backup files
|
||||
*.tmp
|
||||
*.temp
|
||||
*~
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5f0e3526b7b08a245a694381f466ff41
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,299 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &985874966542180765
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 985874966542180762}
|
||||
- component: {fileID: 985874966542180760}
|
||||
- component: {fileID: 985874966542180763}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &985874966542180762
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874966542180765}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 985874967725327421}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &985874966542180760
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874966542180765}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &985874966542180763
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874966542180765}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 25
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
--- !u!1 &985874967524545953
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 985874967524545966}
|
||||
- component: {fileID: 985874967524545964}
|
||||
- component: {fileID: 985874967524545967}
|
||||
m_Layer: 5
|
||||
m_Name: Placeholder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &985874967524545966
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967524545953}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 985874967725327421}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &985874967524545964
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967524545953}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &985874967524545967
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967524545953}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 25
|
||||
m_FontStyle: 2
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Enter equation...
|
||||
--- !u!1 &985874967725327420
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 985874967725327421}
|
||||
- component: {fileID: 985874967725327416}
|
||||
- component: {fileID: 985874967725327419}
|
||||
- component: {fileID: 985874967725327418}
|
||||
m_Layer: 5
|
||||
m_Name: INPTEquation
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &985874967725327421
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967725327420}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 985874967524545966}
|
||||
- {fileID: 985874966542180762}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 600, y: 75}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &985874967725327416
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967725327420}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &985874967725327419
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967725327420}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &985874967725327418
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985874967725327420}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 985874967725327419}
|
||||
m_TextComponent: {fileID: 985874966542180763}
|
||||
m_Placeholder: {fileID: 985874967524545967}
|
||||
m_ContentType: 0
|
||||
m_InputType: 0
|
||||
m_AsteriskChar: 42
|
||||
m_KeyboardType: 0
|
||||
m_LineType: 0
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 0
|
||||
m_CharacterLimit: 0
|
||||
m_OnEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_CustomCaretColor: 0
|
||||
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
|
||||
m_Text:
|
||||
m_CaretBlinkRate: 0.85
|
||||
m_CaretWidth: 1
|
||||
m_ReadOnly: 0
|
||||
m_ShouldActivateOnSelect: 1
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fccb4ef9675556c439d94f41f15a8e1a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,299 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2895230885503808811
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2895230885503808810}
|
||||
- component: {fileID: 2895230885503808807}
|
||||
- component: {fileID: 2895230885503808808}
|
||||
- component: {fileID: 2895230885503808809}
|
||||
m_Layer: 5
|
||||
m_Name: INPTInitialPoint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2895230885503808810
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230885503808811}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 2895230886245064501}
|
||||
- {fileID: 2895230886262753959}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 75}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2895230885503808807
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230885503808811}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2895230885503808808
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230885503808811}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &2895230885503808809
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230885503808811}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2895230885503808808}
|
||||
m_TextComponent: {fileID: 2895230886262753958}
|
||||
m_Placeholder: {fileID: 2895230886245064500}
|
||||
m_ContentType: 3
|
||||
m_InputType: 0
|
||||
m_AsteriskChar: 42
|
||||
m_KeyboardType: 2
|
||||
m_LineType: 0
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 2
|
||||
m_CharacterLimit: 15
|
||||
m_OnEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_CustomCaretColor: 0
|
||||
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
|
||||
m_Text:
|
||||
m_CaretBlinkRate: 0.85
|
||||
m_CaretWidth: 1
|
||||
m_ReadOnly: 0
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!1 &2895230886245064502
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2895230886245064501}
|
||||
- component: {fileID: 2895230886245064499}
|
||||
- component: {fileID: 2895230886245064500}
|
||||
m_Layer: 5
|
||||
m_Name: Placeholder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2895230886245064501
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230886245064502}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2895230885503808810}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2895230886245064499
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230886245064502}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2895230886245064500
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230886245064502}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 25
|
||||
m_FontStyle: 2
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Initial point...
|
||||
--- !u!1 &2895230886262753960
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2895230886262753959}
|
||||
- component: {fileID: 2895230886262753957}
|
||||
- component: {fileID: 2895230886262753958}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2895230886262753959
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230886262753960}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2895230885503808810}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2895230886262753957
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230886262753960}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2895230886262753958
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2895230886262753960}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 25
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dce03982ff0627e459979d3e508a5463
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,299 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2006212224380440147
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2006212224380440146}
|
||||
- component: {fileID: 2006212224380440148}
|
||||
- component: {fileID: 2006212224380440149}
|
||||
m_Layer: 5
|
||||
m_Name: Placeholder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2006212224380440146
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224380440147}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2006212224861606533}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2006212224380440148
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224380440147}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2006212224380440149
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224380440147}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 22
|
||||
m_FontStyle: 2
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Variable
|
||||
--- !u!1 &2006212224861606530
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2006212224861606533}
|
||||
- component: {fileID: 2006212224861606534}
|
||||
- component: {fileID: 2006212224861606535}
|
||||
- component: {fileID: 2006212224861606532}
|
||||
m_Layer: 5
|
||||
m_Name: INPTVariable
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2006212224861606533
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224861606530}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 2006212224380440146}
|
||||
- {fileID: 2006212225912600286}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 75}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2006212224861606534
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224861606530}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2006212224861606535
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224861606530}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &2006212224861606532
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212224861606530}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2006212224861606535}
|
||||
m_TextComponent: {fileID: 2006212225912600097}
|
||||
m_Placeholder: {fileID: 2006212224380440149}
|
||||
m_ContentType: 4
|
||||
m_InputType: 0
|
||||
m_AsteriskChar: 42
|
||||
m_KeyboardType: 1
|
||||
m_LineType: 0
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 3
|
||||
m_CharacterLimit: 1
|
||||
m_OnEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_CustomCaretColor: 0
|
||||
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
|
||||
m_Text:
|
||||
m_CaretBlinkRate: 0.85
|
||||
m_CaretWidth: 1
|
||||
m_ReadOnly: 0
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!1 &2006212225912600287
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2006212225912600286}
|
||||
- component: {fileID: 2006212225912600096}
|
||||
- component: {fileID: 2006212225912600097}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2006212225912600286
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212225912600287}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2006212224861606533}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2006212225912600096
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212225912600287}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &2006212225912600097
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006212225912600287}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 30
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e7b5d763b32e0e44494864207f0d5275
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4eb5aeac669694c45af64b5730fe82ca
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 45eed84873cca754480c39540b8f1e50
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bcc23a5940935d5449776ed5bdf22e57
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4624df48b44672048904abdf49a34331
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class FunctionEvaluator : MonoBehaviour
|
||||
{
|
||||
public bool Check = false;
|
||||
public string MainEquation1, MainEquation2, MainEquation3, MainEquation4, MainEquation5;
|
||||
public int Count;
|
||||
public double var1;
|
||||
public int var2;
|
||||
|
||||
|
||||
public List<string> Equations = new List<string>(), VariableNames = new List<string>();
|
||||
public List<double> VariableInitialValues = new List<double>();
|
||||
|
||||
Dictionary<string, decimal> dict = new Dictionary<string, decimal>();
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Check)
|
||||
{
|
||||
Check = false;
|
||||
|
||||
//Debug.Log(NumericalMethods.Method_Derivative(MainEquation1, var1, "x", 0).ToString("0." + new string('#', 339)));
|
||||
//Debug.Log(NumericalMethods.Method_TaylorSeries(MainEquation1, 6, "x", 0));
|
||||
|
||||
dict.Clear();
|
||||
for (int i = 0; i < VariableNames.Count; i++)
|
||||
{
|
||||
dict.Add(VariableNames[i], (decimal)VariableInitialValues[i]);
|
||||
}
|
||||
|
||||
Debug.Log(DecimalMath.Cos(90));
|
||||
string res = NumericalMethods.Method_TaylorSeries(MainEquation1, Count, "x", 1, 0.01m).Replace(',', '.');
|
||||
Debug.Log(res);
|
||||
|
||||
|
||||
|
||||
//Debug.Log(NumericalMethods.Method_NumericalPartialDifferentiation("x^2+2*x*y", 2, "x", dict, 6, 0.01m));
|
||||
//Debug.Log(NumericalMethods.Method_NumericalDifferentiation("log(x)", 3, "x", 2, 2));
|
||||
|
||||
/*Dictionary<string, decimal> results = NumericalMethods.MethodMultiVar_SolveEquationSystem(Equations, dict, Count);
|
||||
|
||||
string sum = "";
|
||||
foreach (KeyValuePair<string, decimal> p in results)
|
||||
{
|
||||
sum += p.Key + ": " + p.Value + ", ";
|
||||
}
|
||||
Debug.Log(sum);*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*string res = NumericalMethods.Method_TaylorSeries(MainEquation1, Count, "x", 0).Replace(',', '.');
|
||||
Debug.Log(res);*/
|
||||
|
||||
//Debug.Log(NumericalMethods.Method_Derivative(MainEquation1, Count, "x", (decimal)var1));
|
||||
|
||||
|
||||
//Debug.Log(NumericalMethods.Method_BisectionMethod(MainEquation1, "x", -4, -2, 20));
|
||||
|
||||
|
||||
|
||||
|
||||
/*Dictionary<string, float> root = NumericalMethods.MethodMultiVar_BisectionMethod(new List<string> { MainEquation1, MainEquation2 }, new List<string> { "x", "y" }, var1, var2, taylorCount);
|
||||
foreach (KeyValuePair<string, float> r in root)
|
||||
{
|
||||
Debug.Log(r.Key + ": " + r.Value);
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*string str = NumericalMethods.GenerateCombinations("-+", "s", 3);
|
||||
Debug.Log(str);
|
||||
string[] test = str.Split('s');
|
||||
|
||||
string str2 = "";
|
||||
for (int i = 0; i < test.Length; i++)
|
||||
{
|
||||
str2 += test[i];
|
||||
}
|
||||
Debug.Log(str2);*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*string e1 = NumericalMethods.MethodMultiVar_TaylorSeries(MainEquation1, 1, dict);
|
||||
string e2 = NumericalMethods.MethodMultiVar_TaylorSeries(MainEquation2, 1, dict);
|
||||
string e3 = NumericalMethods.MethodMultiVar_TaylorSeries(MainEquation3, 1, dict);
|
||||
Debug.Log(e1 + " | " + e2 + " | " + e3);
|
||||
|
||||
float[][] tea = new float[][] { new float[] { 3, 7, -2 }, new float[] { -1, 1, 2 }, new float[] { 3, -2, -1 } };
|
||||
float[] leftv = new float[] { -5, 2, -1 };
|
||||
float[] res = Matrix.SolveEquation(tea, leftv);
|
||||
string sum = "";
|
||||
for (int i = 0; i < res.Length; i++) sum += res[i] + ", ";
|
||||
Debug.Log(sum);*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*Dictionary<string, float> testt = new Dictionary<string, float>();
|
||||
testt.Add("x", 1);
|
||||
testt.Add("y", 2);
|
||||
Debug.Log(NumericalMethods.Method_PartialDerivative("x^(3*y)*y^x", 1, "x", testt, 0.001f));*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*List<string> LES = new List<string>();
|
||||
LES.Add(MainEquation1);
|
||||
LES.Add(MainEquation2);
|
||||
LES.Add(MainEquation3);
|
||||
List<string> VARS = new List<string>();
|
||||
VARS.Add("x");
|
||||
VARS.Add("y");
|
||||
VARS.Add("z");
|
||||
float[][] test = Matrix.ConvertLinearEquationsToMatrix(LES, VARS);
|
||||
|
||||
string deb = "";
|
||||
for (int i = 0; i < test.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < test[i].Length; j++)
|
||||
{
|
||||
deb += test[i][j].ToString() + ", ";
|
||||
}
|
||||
deb += "\n";
|
||||
}
|
||||
Debug.Log(deb);*/
|
||||
|
||||
|
||||
|
||||
|
||||
//Debug.Log(NumericalMethods.MethodMultiVar_TaylorSeries(MainEquation2, 1, dict));
|
||||
|
||||
|
||||
|
||||
|
||||
//Debug.Log(NumericalMethods.Method_PartialDerivative(MainEquation, 1, "x", dict, 0.01f));
|
||||
|
||||
|
||||
|
||||
|
||||
/*Function f = new Function();
|
||||
f.Parse(MainEquation1);
|
||||
f.Infix2Postfix();
|
||||
f.EvaluatePostfix();
|
||||
Debug.Log(f.m_result);
|
||||
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < f.m_equation.Count; i++)
|
||||
{
|
||||
Debug.Log("EEEEE: " + f.m_equation[i].ToString());
|
||||
}
|
||||
for (int i = 0; i < f.m_postfix.Count; i++)
|
||||
{
|
||||
Debug.Log("PPPPP: " + f.m_postfix[i].ToString());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d781ba518f05a794a879f2df79d6c6b8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2462d4b55c2c2d3438a6fc61d3b6445a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bf225744eb8d4a743bc0a97d95a0d137
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e3a2b7302aee27d49b7dae10fc2c43b2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8fa5c66b38ce32f47b0959bb0315cd3b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 724de4fb0b68d7641852aedf09ccc5c2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 17b819c1b38065c4383c9c8112d2e300
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 80c5f324489884149b7fd041dd174bf8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 834d344a2e4c6e0468fcd799e751ff9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eabb80de3b87ba64497fe5d6b0644c47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 82b9a4758390a7b44822597c7c1b24a4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EquationSystem : MonoBehaviour
|
||||
{
|
||||
public static List<Equation> Equations = new List<Equation>();
|
||||
public static int VarCount = 3;
|
||||
}
|
||||
|
||||
public class Equation
|
||||
{
|
||||
public string EquationString = "";
|
||||
public bool MultiVariable = false;
|
||||
|
||||
public List<float> Coefficients = new List<float>();
|
||||
public List<string> Variables = new List<string>();
|
||||
public float Constant;
|
||||
public List<Operation> Operations = new List<Operation>();
|
||||
|
||||
public Equation(List<float> coeffs, float cons, List<string> vars = null, bool multiVar = false)
|
||||
{
|
||||
Coefficients = coeffs;
|
||||
Variables = vars;
|
||||
Constant = cons;
|
||||
MultiVariable = multiVar;
|
||||
EquationString = ConvertEquationToString();
|
||||
}
|
||||
public Equation(string eq)
|
||||
{
|
||||
List<float> coeffs = new List<float>();
|
||||
float cons = 0;
|
||||
string testSTR = "";
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '+' || eq[i] == '-')
|
||||
{
|
||||
testSTR = "";
|
||||
}
|
||||
if (eq[i] == '*')
|
||||
{
|
||||
coeffs.Add(float.Parse(testSTR));
|
||||
testSTR = "";
|
||||
}
|
||||
testSTR += eq[i];
|
||||
}
|
||||
|
||||
char op = 'a';
|
||||
testSTR = "";
|
||||
for (int i = eq.Length - 1; i >= 0; i--)
|
||||
{
|
||||
if (eq[i] == '+' || eq[i] == '-')
|
||||
{
|
||||
op = eq[i];
|
||||
string newstr = "";
|
||||
for (int j = testSTR.Length - 1; j >= 0; j--)
|
||||
{
|
||||
newstr += testSTR[j];
|
||||
}
|
||||
testSTR = op + newstr;
|
||||
cons = (testSTR.Length > 0) ? float.Parse(testSTR) : 0f;
|
||||
break;
|
||||
}
|
||||
testSTR += eq[i];
|
||||
}
|
||||
|
||||
Coefficients = coeffs;
|
||||
Constant = cons;
|
||||
Variables = null;
|
||||
MultiVariable = false;
|
||||
}
|
||||
|
||||
public string ConvertEquationToString()
|
||||
{
|
||||
string newEq = "";
|
||||
for(int i = 0; i < Coefficients.Count; i++)
|
||||
{
|
||||
if (i == Coefficients.Count - 1)
|
||||
{
|
||||
if (Coefficients[i] > 0)
|
||||
{
|
||||
newEq += "+" + Coefficients[i].ToString() + "*x";
|
||||
}
|
||||
else if (Coefficients[i] < 0)
|
||||
{
|
||||
newEq += Coefficients[i].ToString() + "*x";
|
||||
}
|
||||
else if (Coefficients[i] == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (i == 0)
|
||||
{
|
||||
if (Coefficients[i] != 0)
|
||||
{
|
||||
newEq += Coefficients[i].ToString() + "*x^" + (Coefficients.Count - i).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Coefficients[i] > 0)
|
||||
{
|
||||
newEq += "+" + Coefficients[i].ToString() + "*x^" + (Coefficients.Count - i).ToString();
|
||||
}
|
||||
else if (Coefficients[i] < 0)
|
||||
{
|
||||
newEq += Coefficients[i].ToString() + "*x^" + (Coefficients.Count - i).ToString();
|
||||
}
|
||||
else if (Coefficients[i] == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Constant > 0)
|
||||
{
|
||||
newEq += "+" + Constant;
|
||||
}
|
||||
else if (Constant < 0)
|
||||
{
|
||||
newEq += Constant;
|
||||
}
|
||||
|
||||
string newSTR = "";
|
||||
for (int i = 0; i < newEq.Length; i++)
|
||||
{
|
||||
if (newEq[i] == ',')
|
||||
{
|
||||
newSTR += '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
newSTR += newEq[i];
|
||||
}
|
||||
}
|
||||
newEq = newSTR;
|
||||
|
||||
return newEq;
|
||||
}
|
||||
|
||||
public void SubstituteEquation(Equation eq)
|
||||
{
|
||||
if (!MultiVariable)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum Operation
|
||||
{
|
||||
ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION, EXPONENTIATION
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c57eddf0ac8df46468098df8caebdc48
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EquationSystem2 : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Equation2
|
||||
{
|
||||
public static char[] AllVariables = new char[] { 'x', 'y', 'z', 't', 'w', 'r' };
|
||||
|
||||
public string EquationString = "";
|
||||
|
||||
public enum Type { Variable, Value, UnaryOperator, Operator, Function, Result, Bracket, Comma, Error }
|
||||
public struct Symbol
|
||||
{
|
||||
string SYM_Name;
|
||||
double SYM_Value;
|
||||
Type SYM_Type;
|
||||
public override string ToString()
|
||||
{
|
||||
return SYM_Name;
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList m_equation = new ArrayList();
|
||||
|
||||
public Equation2(string eq)
|
||||
{
|
||||
EquationString = eq;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 86ef5945fb00cd74db15c2c37e803dce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,306 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FunctionEvaluator2 : MonoBehaviour
|
||||
{
|
||||
public List<string> Chars = new List<string>();
|
||||
List<char> Operators = new List<char> { '+', '-', '*', '/', '^' };
|
||||
|
||||
string Evaluate(string eq)
|
||||
{
|
||||
int deepestP = FindDeepestParenthesis(eq);
|
||||
int closeDeepestP = (deepestP == -1) ? -1 : FindClosedParenthesis(eq, deepestP);
|
||||
|
||||
if (closeDeepestP != -1)
|
||||
{
|
||||
string newEq = eq.Substring(deepestP + 1, closeDeepestP - deepestP - 1);
|
||||
return Evaluate(newEq);
|
||||
}
|
||||
else
|
||||
{
|
||||
Chars.Clear();
|
||||
string newChar = "";
|
||||
bool containsOperator = true;
|
||||
|
||||
while (containsOperator)
|
||||
{
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (Operators.Contains(eq[i]))
|
||||
{
|
||||
Chars.Add(newChar);
|
||||
newChar = eq[i].ToString();
|
||||
Chars.Add(newChar);
|
||||
newChar = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (eq[i] != '(' && eq[i] != ')')
|
||||
{
|
||||
newChar += eq[i];
|
||||
}
|
||||
if (i == eq.Length - 1)
|
||||
{
|
||||
Chars.Add(newChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Chars.Contains("^"))
|
||||
{
|
||||
int pow = (int)Mathf.Pow(GetLeftNumber(eq, FindClosestPower(eq)), GetRightNumber(eq, FindClosestPower(eq)));
|
||||
|
||||
eq = ReplaceWith(eq, pow.ToString(), GetLeftNumberIndex(eq, FindClosestPower(eq)), GetRightNumberIndex(eq, FindClosestPower(eq)));
|
||||
}
|
||||
else if (Chars.Contains("*"))
|
||||
{
|
||||
int mult = GetLeftNumber(eq, FindClosestMultiplication(eq)) * GetRightNumber(eq, FindClosestMultiplication(eq));
|
||||
|
||||
eq = ReplaceWith(eq, mult.ToString(), GetLeftNumberIndex(eq, FindClosestMultiplication(eq)), GetRightNumberIndex(eq, FindClosestMultiplication(eq)));
|
||||
}
|
||||
else if (Chars.Contains("/"))
|
||||
{
|
||||
int div = (int)(GetLeftNumber(eq, FindClosestDivision(eq)) / GetRightNumber(eq, FindClosestDivision(eq)));
|
||||
|
||||
eq = ReplaceWith(eq, div.ToString(), GetLeftNumberIndex(eq, FindClosestDivision(eq)), GetRightNumberIndex(eq, FindClosestDivision(eq)));
|
||||
}
|
||||
else if (Chars.Contains("+"))
|
||||
{
|
||||
int sum = GetLeftNumber(eq, FindClosestAddition(eq)) + GetRightNumber(eq, FindClosestAddition(eq));
|
||||
|
||||
eq = ReplaceWith(eq, sum.ToString(), GetLeftNumberIndex(eq, FindClosestAddition(eq)), GetRightNumberIndex(eq, FindClosestAddition(eq)));
|
||||
}
|
||||
else if (Chars.Contains("-"))
|
||||
{
|
||||
int sub = GetLeftNumber(eq, FindClosestSubtraction(eq)) - GetRightNumber(eq, FindClosestSubtraction(eq));
|
||||
|
||||
eq = ReplaceWith(eq, sub.ToString(), GetLeftNumberIndex(eq, FindClosestSubtraction(eq)), GetRightNumberIndex(eq, FindClosestSubtraction(eq)));
|
||||
}
|
||||
|
||||
|
||||
bool contains = false;
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (Operators.Contains(eq[i]))
|
||||
{
|
||||
contains = true;
|
||||
}
|
||||
}
|
||||
|
||||
containsOperator = contains;
|
||||
}
|
||||
|
||||
|
||||
return eq;
|
||||
}
|
||||
}
|
||||
|
||||
string ReplaceWith(string replacedStr, string replacingStr, int start, int end)
|
||||
{
|
||||
string ans = replacedStr;
|
||||
ans = ans.Remove(start, end - start);
|
||||
|
||||
string newStr = "";
|
||||
for (int i = start; i < ans.Length; i++)
|
||||
{
|
||||
newStr += ans[i];
|
||||
}
|
||||
ans = ans.Remove(start);
|
||||
|
||||
ans += replacingStr;
|
||||
ans += newStr;
|
||||
|
||||
return ans;
|
||||
}
|
||||
|
||||
int GetLeftNumber(string eq, int index)
|
||||
{
|
||||
string ans = "";
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
ans += eq[i];
|
||||
if (Operators.Contains(eq[i]))
|
||||
{
|
||||
ans = "";
|
||||
}
|
||||
Debug.Log(ans + " / " + index + " / " + i);
|
||||
}
|
||||
Debug.Log(ans + " / " + index);
|
||||
|
||||
return int.Parse(ans);
|
||||
}
|
||||
int GetLeftNumberIndex(string eq, int index)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = index - 1; i >= 0; i--)
|
||||
{
|
||||
if (Operators.Contains(eq[i]))
|
||||
{
|
||||
ans = i + 1;
|
||||
break;
|
||||
}
|
||||
if (i == 0)
|
||||
ans = 0;
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
int GetRightNumber(string eq, int index)
|
||||
{
|
||||
string ans = "";
|
||||
for (int i = index + 1; i < eq.Length; i++)
|
||||
{
|
||||
if (Operators.Contains(eq[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ans += eq[i];
|
||||
}
|
||||
}
|
||||
return int.Parse(ans);
|
||||
}
|
||||
int GetRightNumberIndex(string eq, int index)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = index + 1; i < eq.Length; i++)
|
||||
{
|
||||
if (Operators.Contains(eq[i]))
|
||||
{
|
||||
ans = i - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
int FindDeepestParenthesis(string eq)
|
||||
{
|
||||
int openedCount = 0, deepestIndex = -1, maxOpenedCount = 0;
|
||||
if (eq.Contains("("))
|
||||
{
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '(')
|
||||
{
|
||||
openedCount++;
|
||||
}
|
||||
else if (eq[i] == ')')
|
||||
{
|
||||
openedCount--;
|
||||
}
|
||||
|
||||
if (openedCount > maxOpenedCount)
|
||||
{
|
||||
maxOpenedCount = openedCount;
|
||||
deepestIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return deepestIndex;
|
||||
}
|
||||
|
||||
int FindClosedParenthesis(string eq, int index)
|
||||
{
|
||||
if (eq[index] == '(')
|
||||
{
|
||||
int openedCount = 1, result = -1;
|
||||
bool counted = false;
|
||||
for (int i = index + 1; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '(')
|
||||
{
|
||||
if (!counted)
|
||||
counted = true;
|
||||
openedCount++;
|
||||
}
|
||||
|
||||
else if (eq[i] == ')')
|
||||
{
|
||||
if (!counted)
|
||||
counted = true;
|
||||
openedCount--;
|
||||
}
|
||||
|
||||
if (counted && openedCount == 0)
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int FindClosestPower(string eq)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '^')
|
||||
{
|
||||
ans = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
int FindClosestMultiplication(string eq)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '*')
|
||||
{
|
||||
ans = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
int FindClosestDivision(string eq)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '/')
|
||||
{
|
||||
ans = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
int FindClosestAddition(string eq)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '+')
|
||||
{
|
||||
ans = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
int FindClosestSubtraction(string eq)
|
||||
{
|
||||
int ans = -1;
|
||||
for (int i = 0; i < eq.Length; i++)
|
||||
{
|
||||
if (eq[i] == '-')
|
||||
{
|
||||
ans = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 271c85a86fed81142b038a88741dda40
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,246 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class NumericalMethods2
|
||||
{
|
||||
public List<Equation> Equations = new List<Equation>();
|
||||
|
||||
#region Create
|
||||
/*public void Create()
|
||||
{
|
||||
Equation eq1 = new Equation(new List<float> { -6, 4, -1 }, -4);
|
||||
Equation eq2 = new Equation(new List<float> { 1, 4, -1 }, 2);
|
||||
Equation eq3 = new Equation(new List<float> { -2, 4, -7 }, 18);
|
||||
Equations.Add(eq1);
|
||||
Equations.Add(eq2);
|
||||
Equations.Add(eq3);
|
||||
|
||||
|
||||
Equations.Clear();
|
||||
|
||||
for (int i = 0; i < EquationSystem.VarCount; i++)
|
||||
{
|
||||
List<float> coeffs = new List<float>();
|
||||
for (int j = 0; j < EquationSystem.VarCount; j++)
|
||||
{
|
||||
coeffs.Add(Random.Range(-10f, 10f));
|
||||
}
|
||||
Equation eq = new Equation(coeffs, Random.Range(-10f, 10f));
|
||||
Equations.Add(eq);
|
||||
}
|
||||
|
||||
string log = "";
|
||||
for (int i = 0; i < EquationSystem.VarCount; i++)
|
||||
{
|
||||
for (int j = 0; j < EquationSystem.VarCount; j++)
|
||||
{
|
||||
log += Equations[i].Coefficients[j] + ((j == EquationSystem.VarCount - 1) ? " " + Equations[i].Constant + "\n" : " ");
|
||||
}
|
||||
}
|
||||
Debug.Log(log);
|
||||
|
||||
MethodLinear_GaussSeidal(Equations, new List<float> { 2f, 2f, 2f }, 3);
|
||||
}*/
|
||||
#endregion
|
||||
|
||||
public static List<float> Method_GaussSeidal(List<Equation> _eq, List<float> initialValues, int iterationCount)
|
||||
{
|
||||
//yakınsama şartı (3x3 matris için) -> |a11|>|a12|+|a13| && |a22|>|a21|+|a23| && |a33|>|a31|+|a32|
|
||||
|
||||
bool convergence = true;
|
||||
List<int> dominantTerms = new List<int>();
|
||||
for (int i = 0; i < _eq.Count; i++)
|
||||
{
|
||||
int currentDominant = -1;
|
||||
bool dominantFound = false;
|
||||
for (int j = 0; j < _eq.Count; j++)
|
||||
{
|
||||
float sum0 = 0;
|
||||
|
||||
for (int k = 0; k < _eq.Count; k++)
|
||||
{
|
||||
if (k != j)
|
||||
{
|
||||
sum0 += Mathf.Abs(_eq[i].Coefficients[k]);
|
||||
}
|
||||
}
|
||||
|
||||
if (Mathf.Abs(_eq[i].Coefficients[j]) > sum0)
|
||||
{
|
||||
currentDominant = j;
|
||||
dominantFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dominantFound)
|
||||
{
|
||||
dominantTerms.Add(currentDominant);
|
||||
}
|
||||
else
|
||||
{
|
||||
dominantTerms.Add(-1);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < dominantTerms.Count && convergence; i++)
|
||||
{
|
||||
for (int j = 0; j < dominantTerms.Count; j++)
|
||||
{
|
||||
if (i != j)
|
||||
{
|
||||
if (dominantTerms[i] == dominantTerms[j])
|
||||
{
|
||||
convergence = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (convergence == false)
|
||||
{
|
||||
Debug.LogError("This matris cannot be solved with Gauss-Seidal Method!");
|
||||
return new List<float>();
|
||||
}
|
||||
else
|
||||
{
|
||||
List<float> answers = initialValues;
|
||||
for (int i = 0; i < iterationCount; i++)
|
||||
{
|
||||
for (int j = 0; j < _eq.Count; j++)
|
||||
{
|
||||
float sum = _eq[j].Constant + _eq[j].Coefficients[j] * answers[j];
|
||||
for (int k = 0; k < _eq.Count; k++)
|
||||
{
|
||||
sum += -_eq[j].Coefficients[k] * answers[k];
|
||||
}
|
||||
answers[j] = sum / _eq[j].Coefficients[j];
|
||||
}
|
||||
}
|
||||
string ansdeb = "";
|
||||
for (int i = 0; i < answers.Count; i++)
|
||||
{
|
||||
ansdeb += answers[i] + ((i == answers.Count - 1) ? "" : ", ");
|
||||
}
|
||||
Debug.Log(ansdeb);
|
||||
|
||||
return answers;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static float Method_EvaluateFunction(Equation eq, float point)
|
||||
{
|
||||
float result = 0;
|
||||
if (!eq.MultiVariable)
|
||||
{
|
||||
float sum = 0;
|
||||
for (int i = 0; i < eq.Coefficients.Count; i++)
|
||||
{
|
||||
sum += eq.Coefficients[i] * Mathf.Pow(point, eq.Coefficients.Count - i);
|
||||
}
|
||||
result = sum + eq.Constant;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Method_EvaluateFunction: The equation is multivariable!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static Equation Method_TaylorSeries(Equation eq, int degree)
|
||||
{
|
||||
float constant = Method_EvaluateFunction(eq, 0);
|
||||
List<float> coeffs = new List<float>();
|
||||
for (int i = 1; i < degree + 1; i++)
|
||||
{
|
||||
float c = Method_Derivative(eq, i, 0, 0.1f) / Factorial(i);
|
||||
coeffs.Add(c);
|
||||
}
|
||||
|
||||
coeffs.Reverse();
|
||||
|
||||
Equation taylorEq = new Equation(coeffs, constant);
|
||||
return taylorEq;
|
||||
}
|
||||
|
||||
public static float Method_NewtonRaphson(Equation eq, float initialValue, int iterationCount)
|
||||
{
|
||||
float Lipschitz = Method_EvaluateFunction(eq, initialValue) * Method_SecondDerivative(eq, initialValue, 0.1f) /
|
||||
Method_FirstDerivative(eq, initialValue, 0.1f) / Method_FirstDerivative(eq, initialValue, 0.1f);
|
||||
|
||||
if (Lipschitz < 1) { }
|
||||
else
|
||||
{
|
||||
Debug.LogError("Wrong initial value!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
float init = initialValue;
|
||||
for (int i = 0; i < iterationCount; i++)
|
||||
{
|
||||
float next = init - Method_EvaluateFunction(eq, init) / Method_FirstDerivative(eq, init, 0.1f);
|
||||
init = next;
|
||||
}
|
||||
return init;
|
||||
}
|
||||
|
||||
public static float Method_Derivative(Equation eq, int degree, float point, float h)
|
||||
{
|
||||
Equation mainEq = eq, resEq = eq;
|
||||
float sum = 0;
|
||||
for (int i = 0; i <= degree; i++)
|
||||
{
|
||||
sum += Mathf.Pow(-1, i) * Combination(degree, i) * Method_EvaluateFunction(eq, point + (degree - i) * h);
|
||||
}
|
||||
float res = sum / Mathf.Pow(h, degree);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static float Method_FirstDerivative(Equation eq, float point, float h)
|
||||
{
|
||||
float fxi = Method_EvaluateFunction(eq, point), fxi1 = Method_EvaluateFunction(eq, point - h), fxi2 = Method_EvaluateFunction(eq, point - 2 * h);
|
||||
return (3 * fxi + fxi2 - 4 * fxi1) / 2 / h;
|
||||
}
|
||||
public static float Method_SecondDerivative(Equation eq, float point, float h)
|
||||
{
|
||||
float fxi = Method_EvaluateFunction(eq, point), fxi1 = Method_EvaluateFunction(eq, point - h), fxi2 = Method_EvaluateFunction(eq, point - 2 * h);
|
||||
return (fxi + fxi2 - 2 * fxi1) / h / h;
|
||||
}
|
||||
public static float Method_ThirdDerivative(Equation eq, float point, float h)
|
||||
{
|
||||
float fxi = Method_EvaluateFunction(eq, point), fxi1 = Method_EvaluateFunction(eq, point - h), fxi2 = Method_EvaluateFunction(eq, point - 2 * h),
|
||||
fxi3 = Method_EvaluateFunction(eq, point - 3 * h), fxi4 = Method_EvaluateFunction(eq, point - 4 * h);
|
||||
return (3 * fxi4 - 14 * fxi3 + 24 * fxi2 - 18 * fxi1 + 5 * fxi) / 2 / h / h / h;
|
||||
|
||||
}
|
||||
public static float Method_FourthDerivative(Equation eq, float point, float h)
|
||||
{
|
||||
float fxi = Method_EvaluateFunction(eq, point), fxi1 = Method_EvaluateFunction(eq, point - h), fxi2 = Method_EvaluateFunction(eq, point - 2 * h),
|
||||
fxi3 = Method_EvaluateFunction(eq, point - 3 * h), fxi4 = Method_EvaluateFunction(eq, point - 4 * h), fxi5 = Method_EvaluateFunction(eq, point - 5 * h);
|
||||
return (-2 * fxi5 + 11 * fxi4 - 24 * fxi3 + 26 * fxi2 - 14 * fxi1 + 3 * fxi) / h / h / h / h;
|
||||
}
|
||||
|
||||
public static int Factorial(int num)
|
||||
{
|
||||
if (num >= 1)
|
||||
{
|
||||
return num * Factorial(num - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
public static int Combination(int n, int k)
|
||||
{
|
||||
int top = Factorial(n);
|
||||
int bot1 = Factorial(n - k);
|
||||
int bot2 = Factorial(k);
|
||||
|
||||
return top / bot1 / bot2;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba64140c4b91bfe479878f521a339495
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UIController : MonoBehaviour
|
||||
{
|
||||
public GameObject PNLMainMenu, PNLEquationRootFinder, PNLEquationSystemSolver, INPTEquation, INPTMinX, INPTMaxX,
|
||||
INPTRoot, INPTRoots, TGLNewtonRaphson, INPTNRInitialPoint, INPTEqVariable, INPTIterationCount, INPTEquationCount,
|
||||
INPTEquationPrefab, INPTVariablePrefab, INPTInitialPointPrefab, ESEquationParent, ESVariableParent, ESInitialPointParent,
|
||||
INPTESIterationCount;
|
||||
public string INPTRootText, INPTRootsText;
|
||||
public bool isNewtonRaphson;
|
||||
|
||||
public void BTNEquationRootFinder()
|
||||
{
|
||||
PNLMainMenu.SetActive(false);
|
||||
PNLEquationRootFinder.SetActive(true);
|
||||
PNLEquationSystemSolver.SetActive(false);
|
||||
}
|
||||
public void BTNEquationSystemSolver()
|
||||
{
|
||||
PNLMainMenu.SetActive(false);
|
||||
PNLEquationRootFinder.SetActive(false);
|
||||
PNLEquationSystemSolver.SetActive(true);
|
||||
}
|
||||
|
||||
public void BTNMainMenuERF()
|
||||
{
|
||||
PNLMainMenu.SetActive(true);
|
||||
PNLEquationRootFinder.SetActive(false);
|
||||
PNLEquationSystemSolver.SetActive(false);
|
||||
|
||||
INPTNRInitialPoint.GetComponent<InputField>().text = "";
|
||||
INPTMaxX.GetComponent<InputField>().text = "";
|
||||
INPTMinX.GetComponent<InputField>().text = "";
|
||||
INPTEqVariable.GetComponent<InputField>().text = "";
|
||||
INPTIterationCount.GetComponent<InputField>().text = "";
|
||||
INPTEquation.GetComponent<InputField>().text = "";
|
||||
}
|
||||
public void BTNMainMenuESS()
|
||||
{
|
||||
PNLMainMenu.SetActive(true);
|
||||
PNLEquationRootFinder.SetActive(false);
|
||||
PNLEquationSystemSolver.SetActive(false);
|
||||
|
||||
for (int i = 0; i < Equations.Count; i++)
|
||||
{
|
||||
Destroy(Equations[i]);
|
||||
Destroy(Variables[i]);
|
||||
Destroy(InitialPoints[i]);
|
||||
}
|
||||
|
||||
Equations.Clear();
|
||||
Variables.Clear();
|
||||
InitialPoints.Clear();
|
||||
|
||||
INPTEquationCount.GetComponent<InputField>().text = "0";
|
||||
}
|
||||
|
||||
public void BTNFindEquationRoot()
|
||||
{
|
||||
string eq = INPTEquation.GetComponent<InputField>().text;
|
||||
string variable = INPTEqVariable.GetComponent<InputField>().text;
|
||||
int iterCount = int.Parse(INPTIterationCount.GetComponent<InputField>().text);
|
||||
|
||||
decimal res = 0;
|
||||
|
||||
if (isNewtonRaphson)
|
||||
{
|
||||
decimal initialP = decimal.Parse(INPTNRInitialPoint.GetComponent<InputField>().text);
|
||||
res = NumericalMethods.Method_NewtonRaphson(eq, variable, initialP, iterCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
decimal minX = decimal.Parse(INPTMinX.GetComponent<InputField>().text);
|
||||
decimal maxX = decimal.Parse(INPTMaxX.GetComponent<InputField>().text);
|
||||
res = NumericalMethods.Method_BisectionMethod(eq, variable, minX, maxX, iterCount);
|
||||
}
|
||||
INPTRootText = res.ToString();
|
||||
INPTRoot.GetComponent<InputField>().text = res.ToString();
|
||||
}
|
||||
public void TGLNewtonRaphsonBisection()
|
||||
{
|
||||
if (TGLNewtonRaphson.GetComponent<Toggle>().isOn)
|
||||
{
|
||||
isNewtonRaphson = true;
|
||||
INPTNRInitialPoint.SetActive(true);
|
||||
INPTMaxX.SetActive(false);
|
||||
INPTMinX.SetActive(false);
|
||||
|
||||
INPTNRInitialPoint.GetComponent<InputField>().text = "";
|
||||
INPTMaxX.GetComponent<InputField>().text = "";
|
||||
INPTMinX.GetComponent<InputField>().text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
isNewtonRaphson = false;
|
||||
INPTNRInitialPoint.SetActive(false);
|
||||
INPTMaxX.SetActive(true);
|
||||
INPTMinX.SetActive(true);
|
||||
|
||||
INPTNRInitialPoint.GetComponent<InputField>().text = "";
|
||||
INPTMaxX.GetComponent<InputField>().text = "";
|
||||
INPTMinX.GetComponent<InputField>().text = "";
|
||||
}
|
||||
}
|
||||
|
||||
public void INPTRootChanged()
|
||||
{
|
||||
INPTRoot.GetComponent<InputField>().text = INPTRootText;
|
||||
}
|
||||
public void INPTRootsChanged()
|
||||
{
|
||||
INPTRoots.GetComponent<InputField>().text = INPTRootsText;
|
||||
}
|
||||
|
||||
List<GameObject> Equations = new List<GameObject>(), Variables = new List<GameObject>(), InitialPoints = new List<GameObject>();
|
||||
public void INPTEquationCountChanged()
|
||||
{
|
||||
int eqCount = INPTEquationCount.GetComponent<InputField>().text != "" ? int.Parse(INPTEquationCount.GetComponent<InputField>().text) : 0;
|
||||
|
||||
for (int i = 0; i < Equations.Count; i++)
|
||||
{
|
||||
Destroy(Equations[i]);
|
||||
Destroy(Variables[i]);
|
||||
Destroy(InitialPoints[i]);
|
||||
}
|
||||
|
||||
Equations.Clear();
|
||||
Variables.Clear();
|
||||
InitialPoints.Clear();
|
||||
|
||||
for (int i = 0; i < eqCount; i++)
|
||||
{
|
||||
GameObject GO1 = Instantiate(INPTEquationPrefab);
|
||||
GO1.transform.SetParent(ESEquationParent.transform);
|
||||
GO1.transform.localScale = Vector3.one;
|
||||
Equations.Add(GO1);
|
||||
|
||||
GameObject GO2 = Instantiate(INPTVariablePrefab);
|
||||
GO2.transform.SetParent(ESVariableParent.transform);
|
||||
GO2.transform.localScale = Vector3.one;
|
||||
Variables.Add(GO2);
|
||||
|
||||
GameObject GO3 = Instantiate(INPTInitialPointPrefab);
|
||||
GO3.transform.SetParent(ESInitialPointParent.transform);
|
||||
GO3.transform.localScale = Vector3.one;
|
||||
InitialPoints.Add(GO3);
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<string, decimal> dict = new Dictionary<string, decimal>();
|
||||
public void BTNFindEquationSystemRoots()
|
||||
{
|
||||
List<string> Eqs = new List<string>();
|
||||
|
||||
dict.Clear();
|
||||
for (int i = 0; i < Equations.Count; i++)
|
||||
{
|
||||
dict.Add(Variables[i].GetComponent<InputField>().text, decimal.Parse(InitialPoints[i].GetComponent<InputField>().text));
|
||||
Eqs.Add(Equations[i].GetComponent<InputField>().text);
|
||||
}
|
||||
|
||||
int iterCount = int.Parse(INPTESIterationCount.GetComponent<InputField>().text);
|
||||
|
||||
Dictionary<string, decimal> results = NumericalMethods.MethodMultiVar_SolveEquationSystem(Eqs, dict, iterCount);
|
||||
|
||||
string sum = "";
|
||||
|
||||
foreach (KeyValuePair<string, decimal> p in results)
|
||||
{
|
||||
sum += p.Key + ": " + p.Value + ", ";
|
||||
}
|
||||
|
||||
INPTRootsText = sum;
|
||||
INPTRoots.GetComponent<InputField>().text = INPTRootsText;
|
||||
}
|
||||
|
||||
public void ExitTheProgram()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a1b44d2e6ad183849baa8b9136dac8ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MathApp", "MathApp\MathApp.csproj", "{F69EC879-1E4E-41CF-A04B-2E5DD14E43D2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F69EC879-1E4E-41CF-A04B-2E5DD14E43D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F69EC879-1E4E-41CF-A04B-2E5DD14E43D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F69EC879-1E4E-41CF-A04B-2E5DD14E43D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F69EC879-1E4E-41CF-A04B-2E5DD14E43D2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DotNetMatrix
|
||||
{
|
||||
|
||||
/// <summary>Cholesky Decomposition.
|
||||
/// For a symmetric, positive definite matrix A, the Cholesky decomposition
|
||||
/// is an lower triangular matrix L so that A = L*L'.
|
||||
/// If the matrix is not symmetric or positive definite, the constructor
|
||||
/// returns a partial decomposition and sets an internal flag that may
|
||||
/// be queried by the isSPD() method.
|
||||
/// </summary>
|
||||
|
||||
[Serializable]
|
||||
public class CholeskyDecomposition : System.Runtime.Serialization.ISerializable
|
||||
{
|
||||
#region Class variables
|
||||
|
||||
/// <summary>Array for internal storage of decomposition.
|
||||
/// @serial internal array storage.
|
||||
/// </summary>
|
||||
private decimal[][] L;
|
||||
|
||||
/// <summary>Row and column dimension (square matrix).
|
||||
/// @serial matrix dimension.
|
||||
/// </summary>
|
||||
private int n;
|
||||
|
||||
/// <summary>Symmetric and positive definite flag.
|
||||
/// @serial is symmetric and positive definite flag.
|
||||
/// </summary>
|
||||
private bool isspd;
|
||||
|
||||
#endregion // Class variables
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>Cholesky algorithm for symmetric and positive definite matrix.</summary>
|
||||
/// <param name="Arg"> Square, symmetric matrix.
|
||||
/// </param>
|
||||
/// <returns> Structure to access L and isspd flag.
|
||||
/// </returns>
|
||||
|
||||
public CholeskyDecomposition(GeneralMatrix Arg)
|
||||
{
|
||||
// Initialize.
|
||||
decimal[][] A = Arg.Array;
|
||||
n = Arg.RowDimension;
|
||||
L = new decimal[n][];
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
L[i] = new decimal[n];
|
||||
}
|
||||
isspd = (Arg.ColumnDimension == n);
|
||||
// Main loop.
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (!isspd) break;
|
||||
decimal[] Lrowj = L[j];
|
||||
decimal d = 0.0m;
|
||||
for (int k = 0; k < j; k++)
|
||||
{
|
||||
decimal[] Lrowk = L[k];
|
||||
decimal s = 0.0m;
|
||||
for (int i = 0; i < k; i++)
|
||||
{
|
||||
s += Lrowk[i] * Lrowj[i];
|
||||
}
|
||||
if (L[k][k] <= 0.0m)
|
||||
{
|
||||
isspd = false;
|
||||
break;
|
||||
}
|
||||
Lrowj[k] = s = (A[j][k] - s) / L[k][k];
|
||||
d = d + s * s;
|
||||
isspd = isspd & (A[k][j] == A[j][k]);
|
||||
}
|
||||
if (!isspd) break;
|
||||
d = A[j][j] - d;
|
||||
isspd = isspd & (d > 0.0m);
|
||||
if (!isspd || d <= 0.0m)
|
||||
{
|
||||
isspd = false;
|
||||
L[j][j] = 0.0m;
|
||||
break;
|
||||
}
|
||||
L[j][j] = DecimalMath.Sqrt(d);
|
||||
for (int k = j + 1; k < n; k++)
|
||||
{
|
||||
L[j][k] = 0.0m;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Constructor
|
||||
|
||||
#region Public Properties
|
||||
/// <summary>Is the matrix symmetric and positive definite?</summary>
|
||||
/// <returns> true if A is symmetric and positive definite.
|
||||
/// </returns>
|
||||
virtual public bool SPD
|
||||
{
|
||||
get
|
||||
{
|
||||
return isspd;
|
||||
}
|
||||
}
|
||||
#endregion // Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>Return triangular factor.</summary>
|
||||
/// <returns> L
|
||||
/// </returns>
|
||||
|
||||
public virtual GeneralMatrix GetL()
|
||||
{
|
||||
return new GeneralMatrix(L, n, n);
|
||||
}
|
||||
|
||||
/// <summary>Solve A*X = B</summary>
|
||||
/// <param name="B"> A Matrix with as many rows as A and any number of columns.
|
||||
/// </param>
|
||||
/// <returns> X so that L*L'*X = B
|
||||
/// </returns>
|
||||
/// <exception cref="System.ArgumentException"> Matrix row dimensions must agree.
|
||||
/// </exception>
|
||||
/// <exception cref="System.SystemException"> Matrix is not symmetric positive definite.
|
||||
/// </exception>
|
||||
|
||||
public virtual GeneralMatrix Solve(GeneralMatrix B)
|
||||
{
|
||||
if (B.RowDimension != n)
|
||||
{
|
||||
throw new System.ArgumentException("Matrix row dimensions must agree.");
|
||||
}
|
||||
if (!isspd)
|
||||
{
|
||||
throw new System.SystemException("Matrix is not symmetric positive definite.");
|
||||
}
|
||||
|
||||
// Copy right hand side.
|
||||
decimal[][] X = B.ArrayCopy;
|
||||
int nx = B.ColumnDimension;
|
||||
|
||||
// Solve L*Y = B;
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[i][j] -= X[k][j] * L[i][k];
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[k][j] /= L[k][k];
|
||||
}
|
||||
}
|
||||
|
||||
// Solve L'*X = Y;
|
||||
for (int k = n - 1; k >= 0; k--)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[k][j] /= L[k][k];
|
||||
}
|
||||
for (int i = 0; i < k; i++)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[i][j] -= X[k][j] * L[k][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return new GeneralMatrix(X, n, nx);
|
||||
}
|
||||
#endregion // Public Methods
|
||||
|
||||
// A method called when serializing this class.
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,496 +0,0 @@
|
|||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of System.Math class for decimal types with high precision.
|
||||
/// </summary>
|
||||
public static class DecimalMath
|
||||
{
|
||||
/// <summary>
|
||||
/// represents PI
|
||||
/// </summary>
|
||||
public const decimal PI = 3.14159265358979323846264338327950288419716939937510M;
|
||||
|
||||
/// <summary>
|
||||
/// represents machine epsilon for decimal comparisons
|
||||
/// </summary>
|
||||
public const decimal Epsilon = 0.0000000000000000001M;
|
||||
|
||||
/// <summary>
|
||||
/// represents 2*PI
|
||||
/// </summary>
|
||||
public const decimal PIx2 = 6.28318530717958647692528676655900576839433879875021M;
|
||||
|
||||
/// <summary>
|
||||
/// represents E
|
||||
/// </summary>
|
||||
public const decimal E = 2.7182818284590452353602874713526624977572470936999595749M;
|
||||
|
||||
/// <summary>
|
||||
/// represents PI/2
|
||||
/// </summary>
|
||||
public const decimal PIdiv2 = 1.570796326794896619231321691639751442098584699687552910487M;
|
||||
|
||||
/// <summary>
|
||||
/// represents PI/4
|
||||
/// </summary>
|
||||
public const decimal PIdiv4 = 0.785398163397448309615660845819875721049292349843776455243M;
|
||||
|
||||
/// <summary>
|
||||
/// represents 1.0/E
|
||||
/// </summary>
|
||||
private const decimal Einv = 0.3678794411714423215955237701614608674458111310317678M;
|
||||
|
||||
/// <summary>
|
||||
/// log(10,E) factor
|
||||
/// </summary>
|
||||
private const decimal Log10Inv = 0.434294481903251827651128918916605082294397005803666566114M;
|
||||
|
||||
/// <summary>
|
||||
/// Zero
|
||||
/// </summary>
|
||||
public const decimal Zero = 0.0M;
|
||||
|
||||
/// <summary>
|
||||
/// One
|
||||
/// </summary>
|
||||
public const decimal One = 1.0M;
|
||||
|
||||
/// <summary>
|
||||
/// Represents 0.5M
|
||||
/// </summary>
|
||||
private const decimal Half = 0.5M;
|
||||
|
||||
/// <summary>
|
||||
/// Max iterations count in Taylor series
|
||||
/// </summary>
|
||||
private const int MaxIteration = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Exp method with full precision across all ranges
|
||||
/// </summary>
|
||||
public static decimal Exp(decimal x)
|
||||
{
|
||||
if (x == Zero) return One;
|
||||
if (x > 66.5m)
|
||||
{
|
||||
throw new OverflowException("Exp argümanı çok büyük (decimal taşması).");
|
||||
}
|
||||
if (x < -70m)
|
||||
{
|
||||
return Zero;
|
||||
}
|
||||
if (x < Zero)
|
||||
{
|
||||
return One / Exp(-x);
|
||||
}
|
||||
|
||||
int count = decimal.ToInt32(decimal.Truncate(x));
|
||||
x -= count;
|
||||
|
||||
int iteration = 1;
|
||||
decimal result = One;
|
||||
decimal factorial = One;
|
||||
decimal cachedResult;
|
||||
do
|
||||
{
|
||||
cachedResult = result;
|
||||
factorial *= x / iteration++;
|
||||
result += factorial;
|
||||
} while (cachedResult != result && iteration < MaxIteration);
|
||||
|
||||
if (count == 0) return result;
|
||||
return result * PowerN(E, count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Pow method
|
||||
/// </summary>
|
||||
public static decimal Pow(decimal value, decimal pow)
|
||||
{
|
||||
if (pow == Zero) return One;
|
||||
if (pow == One) return value;
|
||||
if (value == One) return One;
|
||||
|
||||
if (value == Zero)
|
||||
{
|
||||
if (pow > Zero) return Zero;
|
||||
throw new DivideByZeroException("Geçersiz İşlem: Sıfır tabanının negatif kuvveti alınamaz.");
|
||||
}
|
||||
|
||||
if (pow == -One) return One / value;
|
||||
|
||||
bool isPowerInteger = IsInteger(pow);
|
||||
if (value < Zero && !isPowerInteger)
|
||||
{
|
||||
// Check if power is reciprocal of an odd integer, e.g. 1/3, 1/5
|
||||
decimal invPow = One / pow;
|
||||
if (IsInteger(invPow))
|
||||
{
|
||||
int q = (int)decimal.Round(invPow);
|
||||
if (q % 2 != 0)
|
||||
{
|
||||
return -Exp(pow * Log(-value));
|
||||
}
|
||||
}
|
||||
throw new ArgumentException("Geçersiz İşlem: Negatif tabanın çift kökü reel sayılarda tanımsızdır.");
|
||||
}
|
||||
|
||||
if (isPowerInteger)
|
||||
{
|
||||
int powerInt = (int)decimal.Round(pow);
|
||||
return PowerN(value, powerInt);
|
||||
}
|
||||
|
||||
return Exp(pow * Log(value));
|
||||
}
|
||||
|
||||
private static bool IsInteger(decimal value)
|
||||
{
|
||||
var rounded = decimal.Round(value);
|
||||
return Abs(value - rounded) <= Epsilon;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Power to the integer value
|
||||
/// </summary>
|
||||
public static decimal PowerN(decimal value, int power)
|
||||
{
|
||||
if (power == 0) return One;
|
||||
if (power < 0)
|
||||
{
|
||||
value = One / value;
|
||||
power = -power;
|
||||
}
|
||||
|
||||
int q = power;
|
||||
decimal prod = One;
|
||||
decimal current = value;
|
||||
while (q > 0)
|
||||
{
|
||||
if (q % 2 == 1)
|
||||
{
|
||||
prod = current * prod;
|
||||
q--;
|
||||
}
|
||||
current *= current;
|
||||
q >>= 1;
|
||||
}
|
||||
return prod;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Log10
|
||||
/// </summary>
|
||||
public static decimal Log10(decimal x)
|
||||
{
|
||||
return Log(x) * Log10Inv;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Log
|
||||
/// </summary>
|
||||
public static decimal Log(decimal x)
|
||||
{
|
||||
if (x <= Zero)
|
||||
{
|
||||
throw new ArgumentException("Logaritma argümanı sıfırdan büyük olmalıdır.");
|
||||
}
|
||||
int count = 0;
|
||||
while (x >= One)
|
||||
{
|
||||
x *= Einv;
|
||||
count++;
|
||||
}
|
||||
while (x <= Einv)
|
||||
{
|
||||
x *= E;
|
||||
count--;
|
||||
}
|
||||
x--;
|
||||
if (x == Zero) return count;
|
||||
|
||||
decimal result = Zero;
|
||||
int iteration = 0;
|
||||
decimal y = One;
|
||||
decimal cacheResult = result - One;
|
||||
while (cacheResult != result && iteration < MaxIteration)
|
||||
{
|
||||
iteration++;
|
||||
cacheResult = result;
|
||||
y *= -x;
|
||||
result += y / iteration;
|
||||
}
|
||||
return count - result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Sin with direct Taylor series (accurate to 28 decimal digits even for small x)
|
||||
/// </summary>
|
||||
public static decimal Sin(decimal x)
|
||||
{
|
||||
TruncateToPeriodicInterval(ref x);
|
||||
|
||||
if (x > PI) x -= PIx2;
|
||||
else if (x < -PI) x += PIx2;
|
||||
|
||||
if (x > PIdiv2) x = PI - x;
|
||||
else if (x < -PIdiv2) x = -PI - x;
|
||||
|
||||
decimal x2 = x * x;
|
||||
decimal term = x;
|
||||
decimal sum = x;
|
||||
decimal cachedSum;
|
||||
for (int i = 1; i < MaxIteration; i++)
|
||||
{
|
||||
cachedSum = sum;
|
||||
term *= -x2 / ((2 * i) * (2 * i + 1));
|
||||
sum += term;
|
||||
if (sum == cachedSum) break;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Cos
|
||||
/// </summary>
|
||||
public static decimal Cos(decimal x)
|
||||
{
|
||||
TruncateToPeriodicInterval(ref x);
|
||||
|
||||
if (x > PI) x -= PIx2;
|
||||
else if (x < -PI) x += PIx2;
|
||||
|
||||
if (x > PIdiv2) return -Cos(PI - x);
|
||||
if (x < -PIdiv2) return -Cos(-PI - x);
|
||||
|
||||
decimal x2 = x * x;
|
||||
decimal term = One;
|
||||
decimal sum = One;
|
||||
decimal cachedSum;
|
||||
for (int i = 1; i < MaxIteration; i++)
|
||||
{
|
||||
cachedSum = sum;
|
||||
term *= -x2 / ((2 * i - 1) * (2 * i));
|
||||
sum += term;
|
||||
if (sum == cachedSum) break;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Tan
|
||||
/// </summary>
|
||||
public static decimal Tan(decimal x)
|
||||
{
|
||||
decimal cos = Cos(x);
|
||||
if (Abs(cos) <= 1e-25m) throw new ArgumentException("Tan(x) bu noktada tanımsızdır (cos(x) = 0).");
|
||||
return Sin(x) / cos;
|
||||
}
|
||||
|
||||
private static void TruncateToPeriodicInterval(ref decimal x)
|
||||
{
|
||||
if (x >= PIx2 || x <= -PIx2)
|
||||
{
|
||||
x = x % PIx2;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Sqrt (Safe against infinite 1-ULP oscillation)
|
||||
/// </summary>
|
||||
public static decimal Sqrt(decimal x, decimal epsilon = Zero)
|
||||
{
|
||||
if (x < Zero) throw new ArgumentException("Negatif sayının karekökü reel sayılarda alınamaz.");
|
||||
if (x == Zero) return Zero;
|
||||
|
||||
decimal current = (decimal)Math.Sqrt((double)x);
|
||||
if (current == Zero) current = x * Half;
|
||||
|
||||
decimal previous = Zero;
|
||||
int maxSteps = 25;
|
||||
for (int step = 0; step < maxSteps; step++)
|
||||
{
|
||||
decimal next = (current + x / current) * Half;
|
||||
if (next == current || next == previous || Abs(next - current) <= epsilon)
|
||||
{
|
||||
return next;
|
||||
}
|
||||
previous = current;
|
||||
current = next;
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Sinh
|
||||
/// </summary>
|
||||
public static decimal Sinh(decimal x)
|
||||
{
|
||||
if (x < Zero) return -Sinh(-x);
|
||||
|
||||
if (Abs(x) < 0.1m)
|
||||
{
|
||||
// Taylor series for small x to avoid loss of significance in (e^x - e^-x)/2
|
||||
decimal x2 = x * x;
|
||||
decimal term = x;
|
||||
decimal sum = x;
|
||||
decimal cachedSum;
|
||||
for (int i = 1; i < MaxIteration; i++)
|
||||
{
|
||||
cachedSum = sum;
|
||||
term *= x2 / ((2 * i) * (2 * i + 1));
|
||||
sum += term;
|
||||
if (sum == cachedSum) break;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
var y = Exp(x);
|
||||
var yy = One / y;
|
||||
return (y - yy) * Half;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Cosh
|
||||
/// </summary>
|
||||
public static decimal Cosh(decimal x)
|
||||
{
|
||||
if (x < Zero) x = -x;
|
||||
var y = Exp(x);
|
||||
var yy = One / y;
|
||||
return (y + yy) * Half;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Sign
|
||||
/// </summary>
|
||||
public static int Sign(decimal x)
|
||||
{
|
||||
return x < Zero ? -1 : (x > Zero ? 1 : 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Tanh
|
||||
/// </summary>
|
||||
public static decimal Tanh(decimal x)
|
||||
{
|
||||
if (x > 35m) return One;
|
||||
if (x < -35m) return -One;
|
||||
|
||||
var y = Exp(2m * x);
|
||||
return (y - One) / (y + One);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Abs
|
||||
/// </summary>
|
||||
public static decimal Abs(decimal x)
|
||||
{
|
||||
return x <= Zero ? -x : x;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Asin
|
||||
/// </summary>
|
||||
public static decimal Asin(decimal x)
|
||||
{
|
||||
if (x > One || x < -One)
|
||||
{
|
||||
throw new ArgumentException("Asin argümanı [-1, 1] aralığında olmalıdır.");
|
||||
}
|
||||
if (x == Zero) return Zero;
|
||||
if (x == One) return PIdiv2;
|
||||
if (x == -One) return -PIdiv2;
|
||||
if (x < Zero) return -Asin(-x);
|
||||
|
||||
var newX = One - 2 * x * x;
|
||||
if (Abs(x) > Abs(newX))
|
||||
{
|
||||
var t = Asin(newX);
|
||||
return Half * (PIdiv2 - t);
|
||||
}
|
||||
|
||||
decimal y = Zero;
|
||||
decimal result = x;
|
||||
decimal cachedResult;
|
||||
int i = 1;
|
||||
y += result;
|
||||
decimal xx = x * x;
|
||||
do
|
||||
{
|
||||
cachedResult = result;
|
||||
result *= xx * (One - Half / i);
|
||||
y += result / ((i << 1) + 1);
|
||||
i++;
|
||||
} while (cachedResult != result && i < MaxIteration);
|
||||
return y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Atan (safe against overflow for large x)
|
||||
/// </summary>
|
||||
public static decimal Atan(decimal x)
|
||||
{
|
||||
if (x == Zero) return Zero;
|
||||
if (x == One) return PIdiv4;
|
||||
if (x == -One) return -PIdiv4;
|
||||
|
||||
if (x > 100000000000000m) return PIdiv2;
|
||||
if (x < -100000000000000m) return -PIdiv2;
|
||||
|
||||
if (x > One)
|
||||
{
|
||||
return PIdiv2 - Atan(One / x);
|
||||
}
|
||||
if (x < -One)
|
||||
{
|
||||
return -PIdiv2 - Atan(One / x);
|
||||
}
|
||||
|
||||
return Asin(x / Sqrt(One + x * x));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Acos
|
||||
/// </summary>
|
||||
public static decimal Acos(decimal x)
|
||||
{
|
||||
if (x > One || x < -One)
|
||||
{
|
||||
throw new ArgumentException("Acos argümanı [-1, 1] aralığında olmalıdır.");
|
||||
}
|
||||
if (x == Zero) return PIdiv2;
|
||||
if (x == One) return Zero;
|
||||
if (x == -One) return PI;
|
||||
if (x < Zero) return PI - Acos(-x);
|
||||
return PIdiv2 - Asin(x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Analogy of Math.Atan2
|
||||
/// </summary>
|
||||
public static decimal Atan2(decimal y, decimal x)
|
||||
{
|
||||
if (x > Zero)
|
||||
{
|
||||
return Atan(y / x);
|
||||
}
|
||||
if (x < Zero && y >= Zero)
|
||||
{
|
||||
return Atan(y / x) + PI;
|
||||
}
|
||||
if (x < Zero && y < Zero)
|
||||
{
|
||||
return Atan(y / x) - PI;
|
||||
}
|
||||
if (x == Zero && y > Zero)
|
||||
{
|
||||
return PIdiv2;
|
||||
}
|
||||
if (x == Zero && y < Zero)
|
||||
{
|
||||
return -PIdiv2;
|
||||
}
|
||||
throw new ArgumentException("Geçersiz Atan2 argümanları (0, 0).");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,931 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DotNetMatrix
|
||||
{
|
||||
[Serializable]
|
||||
public class EigenvalueDecomposition : System.Runtime.Serialization.ISerializable
|
||||
{
|
||||
private int n;
|
||||
private bool issymmetric;
|
||||
private decimal[] d, e;
|
||||
private decimal[][] V;
|
||||
private decimal[][] H;
|
||||
private decimal[] ort;
|
||||
|
||||
private void tred2()
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
d[j] = V[n - 1][j];
|
||||
}
|
||||
|
||||
for (int i = n - 1; i > 0; i--)
|
||||
{
|
||||
decimal scale = 0.0m;
|
||||
decimal h = 0.0m;
|
||||
for (int k = 0; k < i; k++)
|
||||
{
|
||||
scale = scale + System.Math.Abs(d[k]);
|
||||
}
|
||||
if (scale == 0.0m)
|
||||
{
|
||||
e[i] = d[i - 1];
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
d[j] = V[i - 1][j];
|
||||
V[i][j] = 0.0m;
|
||||
V[j][i] = 0.0m;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int k = 0; k < i; k++)
|
||||
{
|
||||
d[k] /= scale;
|
||||
h += d[k] * d[k];
|
||||
}
|
||||
decimal f = d[i - 1];
|
||||
decimal g = (decimal)DecimalMath.Sqrt(h);
|
||||
if (f > 0)
|
||||
{
|
||||
g = - g;
|
||||
}
|
||||
e[i] = scale * g;
|
||||
h = h - f * g;
|
||||
d[i - 1] = f - g;
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
e[j] = 0.0m;
|
||||
}
|
||||
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
f = d[j];
|
||||
V[j][i] = f;
|
||||
g = e[j] + V[j][j] * f;
|
||||
for (int k = j + 1; k <= i - 1; k++)
|
||||
{
|
||||
g += V[k][j] * d[k];
|
||||
e[k] += V[k][j] * f;
|
||||
}
|
||||
e[j] = g;
|
||||
}
|
||||
f = 0.0m;
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
e[j] /= h;
|
||||
f += e[j] * d[j];
|
||||
}
|
||||
decimal hh = f / (h + h);
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
e[j] -= hh * d[j];
|
||||
}
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
f = d[j];
|
||||
g = e[j];
|
||||
for (int k = j; k <= i - 1; k++)
|
||||
{
|
||||
V[k][j] -= (f * e[k] + g * d[k]);
|
||||
}
|
||||
d[j] = V[i - 1][j];
|
||||
V[i][j] = 0.0m;
|
||||
}
|
||||
}
|
||||
d[i] = h;
|
||||
}
|
||||
|
||||
for (int i = 0; i < n - 1; i++)
|
||||
{
|
||||
V[n - 1][i] = V[i][i];
|
||||
V[i][i] = 1.0m;
|
||||
decimal h = d[i + 1];
|
||||
if (h != 0.0m)
|
||||
{
|
||||
for (int k = 0; k <= i; k++)
|
||||
{
|
||||
d[k] = V[k][i + 1] / h;
|
||||
}
|
||||
for (int j = 0; j <= i; j++)
|
||||
{
|
||||
decimal g = 0.0m;
|
||||
for (int k = 0; k <= i; k++)
|
||||
{
|
||||
g += V[k][i + 1] * V[k][j];
|
||||
}
|
||||
for (int k = 0; k <= i; k++)
|
||||
{
|
||||
V[k][j] -= g * d[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int k = 0; k <= i; k++)
|
||||
{
|
||||
V[k][i + 1] = 0.0m;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
d[j] = V[n - 1][j];
|
||||
V[n - 1][j] = 0.0m;
|
||||
}
|
||||
V[n - 1][n - 1] = 1.0m;
|
||||
e[0] = 0.0m;
|
||||
}
|
||||
|
||||
private void tql2()
|
||||
{
|
||||
for (int i = 1; i < n; i++)
|
||||
{
|
||||
e[i - 1] = e[i];
|
||||
}
|
||||
e[n - 1] = 0.0m;
|
||||
|
||||
decimal f = 0.0m;
|
||||
decimal tst1 = 0.0m;
|
||||
decimal eps = DecimalMath.Pow(2.0m, -64.0m);
|
||||
for (int l = 0; l < n; l++)
|
||||
{
|
||||
tst1 = System.Math.Max(tst1, System.Math.Abs(d[l]) + System.Math.Abs(e[l]));
|
||||
int m = l;
|
||||
while (m < n)
|
||||
{
|
||||
if (System.Math.Abs(e[m]) <= eps * tst1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
m++;
|
||||
}
|
||||
|
||||
if (m > l)
|
||||
{
|
||||
int iter = 0;
|
||||
do
|
||||
{
|
||||
iter = iter + 1;
|
||||
if (iter > 120) break;
|
||||
decimal g = d[l];
|
||||
decimal p = (d[l + 1] - g) / (2.0m * e[l]);
|
||||
decimal r = Maths.Hypot(p, 1.0m);
|
||||
if (p < 0)
|
||||
{
|
||||
r = - r;
|
||||
}
|
||||
d[l] = e[l] / (p + r);
|
||||
d[l + 1] = e[l] * (p + r);
|
||||
decimal dl1 = d[l + 1];
|
||||
decimal h = g - d[l];
|
||||
for (int i = l + 2; i < n; i++)
|
||||
{
|
||||
d[i] -= h;
|
||||
}
|
||||
f = f + h;
|
||||
|
||||
p = d[m];
|
||||
decimal c = 1.0m;
|
||||
decimal c2 = c;
|
||||
decimal c3 = c;
|
||||
decimal el1 = e[l + 1];
|
||||
decimal s = 0.0m;
|
||||
decimal s2 = 0.0m;
|
||||
for (int i = m - 1; i >= l; i--)
|
||||
{
|
||||
c3 = c2;
|
||||
c2 = c;
|
||||
s2 = s;
|
||||
g = c * e[i];
|
||||
h = c * p;
|
||||
r = Maths.Hypot(p, e[i]);
|
||||
e[i + 1] = s * r;
|
||||
s = e[i] / r;
|
||||
c = p / r;
|
||||
p = c * d[i] - s * g;
|
||||
d[i + 1] = h + s * (c * g + s * d[i]);
|
||||
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
h = V[k][i + 1];
|
||||
V[k][i + 1] = s * V[k][i] + c * h;
|
||||
V[k][i] = c * V[k][i] - s * h;
|
||||
}
|
||||
}
|
||||
p = (- s) * s2 * c3 * el1 * e[l] / dl1;
|
||||
e[l] = s * p;
|
||||
d[l] = c * p;
|
||||
}
|
||||
while (System.Math.Abs(e[l]) > eps * tst1);
|
||||
}
|
||||
d[l] = d[l] + f;
|
||||
e[l] = 0.0m;
|
||||
}
|
||||
|
||||
for (int i = 0; i < n - 1; i++)
|
||||
{
|
||||
int k = i;
|
||||
decimal p = d[i];
|
||||
for (int j = i + 1; j < n; j++)
|
||||
{
|
||||
if (d[j] < p)
|
||||
{
|
||||
k = j;
|
||||
p = d[j];
|
||||
}
|
||||
}
|
||||
if (k != i)
|
||||
{
|
||||
d[k] = d[i];
|
||||
d[i] = p;
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
p = V[j][i];
|
||||
V[j][i] = V[j][k];
|
||||
V[j][k] = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void orthes()
|
||||
{
|
||||
int low = 0;
|
||||
int high = n - 1;
|
||||
|
||||
for (int m = low + 1; m <= high - 1; m++)
|
||||
{
|
||||
decimal scale = 0.0m;
|
||||
for (int i = m; i <= high; i++)
|
||||
{
|
||||
scale = scale + System.Math.Abs(H[i][m - 1]);
|
||||
}
|
||||
if (scale != 0.0m)
|
||||
{
|
||||
decimal h = 0.0m;
|
||||
for (int i = high; i >= m; i--)
|
||||
{
|
||||
ort[i] = H[i][m - 1] / scale;
|
||||
h += ort[i] * ort[i];
|
||||
}
|
||||
decimal g = (decimal)DecimalMath.Sqrt(h);
|
||||
if (ort[m] > 0)
|
||||
{
|
||||
g = - g;
|
||||
}
|
||||
h = h - ort[m] * g;
|
||||
ort[m] = ort[m] - g;
|
||||
|
||||
for (int j = m; j < n; j++)
|
||||
{
|
||||
decimal f = 0.0m;
|
||||
for (int i = high; i >= m; i--)
|
||||
{
|
||||
f += ort[i] * H[i][j];
|
||||
}
|
||||
f = f / h;
|
||||
for (int i = m; i <= high; i++)
|
||||
{
|
||||
H[i][j] -= f * ort[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i <= high; i++)
|
||||
{
|
||||
decimal f = 0.0m;
|
||||
for (int j = high; j >= m; j--)
|
||||
{
|
||||
f += ort[j] * H[i][j];
|
||||
}
|
||||
f = f / h;
|
||||
for (int j = m; j <= high; j++)
|
||||
{
|
||||
H[i][j] -= f * ort[j];
|
||||
}
|
||||
}
|
||||
ort[m] = scale * ort[m];
|
||||
H[m][m - 1] = scale * g;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
V[i][j] = (i == j?1.0m:0.0m);
|
||||
}
|
||||
}
|
||||
|
||||
for (int m = high - 1; m >= low + 1; m--)
|
||||
{
|
||||
if (H[m][m - 1] != 0.0m)
|
||||
{
|
||||
for (int i = m + 1; i <= high; i++)
|
||||
{
|
||||
ort[i] = H[i][m - 1];
|
||||
}
|
||||
for (int j = m; j <= high; j++)
|
||||
{
|
||||
decimal g = 0.0m;
|
||||
for (int i = m; i <= high; i++)
|
||||
{
|
||||
g += ort[i] * V[i][j];
|
||||
}
|
||||
g = (g / ort[m]) / H[m][m - 1];
|
||||
for (int i = m; i <= high; i++)
|
||||
{
|
||||
V[i][j] += g * ort[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[NonSerialized()]
|
||||
private decimal cdivr, cdivi;
|
||||
|
||||
private void cdiv(decimal xr, decimal xi, decimal yr, decimal yi)
|
||||
{
|
||||
decimal r, d;
|
||||
if (System.Math.Abs(yr) > System.Math.Abs(yi))
|
||||
{
|
||||
r = yi / yr;
|
||||
d = yr + r * yi;
|
||||
cdivr = (xr + r * xi) / d;
|
||||
cdivi = (xi - r * xr) / d;
|
||||
}
|
||||
else
|
||||
{
|
||||
r = yr / yi;
|
||||
d = yi + r * yr;
|
||||
cdivr = (r * xr + xi) / d;
|
||||
cdivi = (r * xi - xr) / d;
|
||||
}
|
||||
}
|
||||
|
||||
private void hqr2()
|
||||
{
|
||||
int nn = this.n;
|
||||
int n = nn - 1;
|
||||
int low = 0;
|
||||
int high = nn - 1;
|
||||
decimal eps = (decimal)DecimalMath.Pow(2.0m, - 52.0m);
|
||||
decimal exshift = 0.0m;
|
||||
decimal p = 0, q = 0, r = 0, s = 0, z = 0, t, w, x, y;
|
||||
|
||||
decimal norm = 0.0m;
|
||||
for (int i = 0; i < nn; i++)
|
||||
{
|
||||
if (i < low | i > high)
|
||||
{
|
||||
d[i] = H[i][i];
|
||||
e[i] = 0.0m;
|
||||
}
|
||||
for (int j = System.Math.Max(i - 1, 0); j < nn; j++)
|
||||
{
|
||||
norm = norm + System.Math.Abs(H[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
int iter = 0;
|
||||
int totalIter = 0;
|
||||
while (n >= low && totalIter < 400)
|
||||
{
|
||||
totalIter++;
|
||||
int l = n;
|
||||
while (l > low)
|
||||
{
|
||||
s = System.Math.Abs(H[l - 1][l - 1]) + System.Math.Abs(H[l][l]);
|
||||
if (s == 0.0m)
|
||||
{
|
||||
s = norm;
|
||||
}
|
||||
if (System.Math.Abs(H[l][l - 1]) < eps * s)
|
||||
{
|
||||
break;
|
||||
}
|
||||
l--;
|
||||
}
|
||||
|
||||
if (l == n)
|
||||
{
|
||||
H[n][n] = H[n][n] + exshift;
|
||||
d[n] = H[n][n];
|
||||
e[n] = 0.0m;
|
||||
n--;
|
||||
iter = 0;
|
||||
}
|
||||
else if (l == n - 1)
|
||||
{
|
||||
w = H[n][n - 1] * H[n - 1][n];
|
||||
p = (H[n - 1][n - 1] - H[n][n]) / 2.0m;
|
||||
q = p * p + w;
|
||||
z = (decimal)DecimalMath.Sqrt(System.Math.Abs(q));
|
||||
H[n][n] = H[n][n] + exshift;
|
||||
H[n - 1][n - 1] = H[n - 1][n - 1] + exshift;
|
||||
x = H[n][n];
|
||||
|
||||
if (q >= 0)
|
||||
{
|
||||
if (p >= 0)
|
||||
{
|
||||
z = p + z;
|
||||
}
|
||||
else
|
||||
{
|
||||
z = p - z;
|
||||
}
|
||||
d[n - 1] = x + z;
|
||||
d[n] = d[n - 1];
|
||||
if (z != 0.0m)
|
||||
{
|
||||
d[n] = x - w / z;
|
||||
}
|
||||
e[n - 1] = 0.0m;
|
||||
e[n] = 0.0m;
|
||||
x = H[n][n - 1];
|
||||
s = System.Math.Abs(x) + System.Math.Abs(z);
|
||||
p = x / s;
|
||||
q = z / s;
|
||||
r = (decimal)DecimalMath.Sqrt(p * p + q * q);
|
||||
p = p / r;
|
||||
q = q / r;
|
||||
|
||||
for (int j = n - 1; j < nn; j++)
|
||||
{
|
||||
z = H[n - 1][j];
|
||||
H[n - 1][j] = q * z + p * H[n][j];
|
||||
H[n][j] = q * H[n][j] - p * z;
|
||||
}
|
||||
|
||||
for (int i = 0; i <= n; i++)
|
||||
{
|
||||
z = H[i][n - 1];
|
||||
H[i][n - 1] = q * z + p * H[i][n];
|
||||
H[i][n] = q * H[i][n] - p * z;
|
||||
}
|
||||
|
||||
for (int i = low; i <= high; i++)
|
||||
{
|
||||
z = V[i][n - 1];
|
||||
V[i][n - 1] = q * z + p * V[i][n];
|
||||
V[i][n] = q * V[i][n] - p * z;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
d[n - 1] = x + p;
|
||||
d[n] = x + p;
|
||||
e[n - 1] = z;
|
||||
e[n] = - z;
|
||||
}
|
||||
n = n - 2;
|
||||
iter = 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
x = H[n][n];
|
||||
y = 0.0m;
|
||||
w = 0.0m;
|
||||
if (l < n)
|
||||
{
|
||||
y = H[n - 1][n - 1];
|
||||
w = H[n][n - 1] * H[n - 1][n];
|
||||
}
|
||||
|
||||
if (iter == 10)
|
||||
{
|
||||
exshift += x;
|
||||
for (int i = low; i <= n; i++)
|
||||
{
|
||||
H[i][i] -= x;
|
||||
}
|
||||
s = System.Math.Abs(H[n][n - 1]) + System.Math.Abs(H[n - 1][n - 2]);
|
||||
x = y = 0.75m * s;
|
||||
w = (- 0.4375m) * s * s;
|
||||
}
|
||||
|
||||
if (iter == 30)
|
||||
{
|
||||
s = (y - x) / 2.0m;
|
||||
s = s * s + w;
|
||||
if (s > 0)
|
||||
{
|
||||
s = (decimal)DecimalMath.Sqrt(s);
|
||||
if (y < x)
|
||||
{
|
||||
s = - s;
|
||||
}
|
||||
s = x - w / ((y - x) / 2.0m + s);
|
||||
for (int i = low; i <= n; i++)
|
||||
{
|
||||
H[i][i] -= s;
|
||||
}
|
||||
exshift += s;
|
||||
x = y = w = 0.964m;
|
||||
}
|
||||
}
|
||||
|
||||
iter = iter + 1;
|
||||
|
||||
int m = n - 2;
|
||||
while (m >= l)
|
||||
{
|
||||
z = H[m][m];
|
||||
r = x - z;
|
||||
s = y - z;
|
||||
p = (r * s - w) / H[m + 1][m] + H[m][m + 1];
|
||||
q = H[m + 1][m + 1] - z - r - s;
|
||||
r = H[m + 2][m + 1];
|
||||
s = System.Math.Abs(p) + System.Math.Abs(q) + System.Math.Abs(r);
|
||||
p = p / s;
|
||||
q = q / s;
|
||||
r = r / s;
|
||||
if (m == l)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (System.Math.Abs(H[m][m - 1]) * (System.Math.Abs(q) + System.Math.Abs(r)) < eps * (System.Math.Abs(p) * (System.Math.Abs(H[m - 1][m - 1]) + System.Math.Abs(z) + System.Math.Abs(H[m + 1][m + 1]))))
|
||||
{
|
||||
break;
|
||||
}
|
||||
m--;
|
||||
}
|
||||
|
||||
for (int i = m + 2; i <= n; i++)
|
||||
{
|
||||
H[i][i - 2] = 0.0m;
|
||||
if (i > m + 2)
|
||||
{
|
||||
H[i][i - 3] = 0.0m;
|
||||
}
|
||||
}
|
||||
|
||||
for (int k = m; k <= n - 1; k++)
|
||||
{
|
||||
bool notlast = (k != n - 1);
|
||||
if (k != m)
|
||||
{
|
||||
p = H[k][k - 1];
|
||||
q = H[k + 1][k - 1];
|
||||
r = (notlast?H[k + 2][k - 1]:0.0m);
|
||||
x = System.Math.Abs(p) + System.Math.Abs(q) + System.Math.Abs(r);
|
||||
if (x != 0.0m)
|
||||
{
|
||||
p = p / x;
|
||||
q = q / x;
|
||||
r = r / x;
|
||||
}
|
||||
}
|
||||
if (x == 0.0m)
|
||||
{
|
||||
break;
|
||||
}
|
||||
s = (decimal)DecimalMath.Sqrt(p * p + q * q + r * r);
|
||||
if (p < 0)
|
||||
{
|
||||
s = - s;
|
||||
}
|
||||
if (s != 0)
|
||||
{
|
||||
if (k != m)
|
||||
{
|
||||
H[k][k - 1] = (- s) * x;
|
||||
}
|
||||
else if (l != m)
|
||||
{
|
||||
H[k][k - 1] = - H[k][k - 1];
|
||||
}
|
||||
p = p + s;
|
||||
x = p / s;
|
||||
y = q / s;
|
||||
z = r / s;
|
||||
q = q / p;
|
||||
r = r / p;
|
||||
|
||||
for (int j = k; j < nn; j++)
|
||||
{
|
||||
p = H[k][j] + q * H[k + 1][j];
|
||||
if (notlast)
|
||||
{
|
||||
p = p + r * H[k + 2][j];
|
||||
H[k + 2][j] = H[k + 2][j] - p * z;
|
||||
}
|
||||
H[k][j] = H[k][j] - p * x;
|
||||
H[k + 1][j] = H[k + 1][j] - p * y;
|
||||
}
|
||||
|
||||
for (int i = 0; i <= System.Math.Min(n, k + 3); i++)
|
||||
{
|
||||
p = x * H[i][k] + y * H[i][k + 1];
|
||||
if (notlast)
|
||||
{
|
||||
p = p + z * H[i][k + 2];
|
||||
H[i][k + 2] = H[i][k + 2] - p * r;
|
||||
}
|
||||
H[i][k] = H[i][k] - p;
|
||||
H[i][k + 1] = H[i][k + 1] - p * q;
|
||||
}
|
||||
|
||||
for (int i = low; i <= high; i++)
|
||||
{
|
||||
p = x * V[i][k] + y * V[i][k + 1];
|
||||
if (notlast)
|
||||
{
|
||||
p = p + z * V[i][k + 2];
|
||||
V[i][k + 2] = V[i][k + 2] - p * r;
|
||||
}
|
||||
V[i][k] = V[i][k] - p;
|
||||
V[i][k + 1] = V[i][k + 1] - p * q;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (norm == 0.0m)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
for (n = nn - 1; n >= 0; n--)
|
||||
{
|
||||
p = d[n];
|
||||
q = e[n];
|
||||
|
||||
if (q == 0)
|
||||
{
|
||||
int l = n;
|
||||
H[n][n] = 1.0m;
|
||||
for (int i = n - 1; i >= 0; i--)
|
||||
{
|
||||
w = H[i][i] - p;
|
||||
r = 0.0m;
|
||||
for (int j = l; j <= n; j++)
|
||||
{
|
||||
r = r + H[i][j] * H[j][n];
|
||||
}
|
||||
if (e[i] < 0.0m)
|
||||
{
|
||||
z = w;
|
||||
s = r;
|
||||
}
|
||||
else
|
||||
{
|
||||
l = i;
|
||||
if (e[i] == 0.0m)
|
||||
{
|
||||
if (w != 0.0m)
|
||||
{
|
||||
H[i][n] = (- r) / w;
|
||||
}
|
||||
else
|
||||
{
|
||||
H[i][n] = (- r) / (eps * norm);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x = H[i][i + 1];
|
||||
y = H[i + 1][i];
|
||||
q = (d[i] - p) * (d[i] - p) + e[i] * e[i];
|
||||
t = (x * s - z * r) / q;
|
||||
H[i][n] = t;
|
||||
if (System.Math.Abs(x) > System.Math.Abs(z))
|
||||
{
|
||||
H[i + 1][n] = (- r - w * t) / x;
|
||||
}
|
||||
else
|
||||
{
|
||||
H[i + 1][n] = (- s - y * t) / z;
|
||||
}
|
||||
}
|
||||
|
||||
t = System.Math.Abs(H[i][n]);
|
||||
if (t > 0 && (t > 1000000000000m || (eps * t) > 1m / t))
|
||||
{
|
||||
for (int j = i; j <= n; j++)
|
||||
{
|
||||
H[j][n] = H[j][n] / t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (q < 0)
|
||||
{
|
||||
int l = n - 1;
|
||||
if (System.Math.Abs(H[n][n - 1]) > System.Math.Abs(H[n - 1][n]))
|
||||
{
|
||||
H[n - 1][n - 1] = q / H[n][n - 1];
|
||||
H[n - 1][n] = (- (H[n][n] - p)) / H[n][n - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
cdiv(0.0m, - H[n - 1][n], H[n - 1][n - 1] - p, q);
|
||||
H[n - 1][n - 1] = cdivr;
|
||||
H[n - 1][n] = cdivi;
|
||||
}
|
||||
H[n][n - 1] = 0.0m;
|
||||
H[n][n] = 1.0m;
|
||||
for (int i = n - 2; i >= 0; i--)
|
||||
{
|
||||
decimal ra, sa, vr, vi;
|
||||
ra = 0.0m;
|
||||
sa = 0.0m;
|
||||
for (int j = l; j <= n; j++)
|
||||
{
|
||||
ra = ra + H[i][j] * H[j][n - 1];
|
||||
sa = sa + H[i][j] * H[j][n];
|
||||
}
|
||||
w = H[i][i] - p;
|
||||
|
||||
if (e[i] < 0.0m)
|
||||
{
|
||||
z = w;
|
||||
r = ra;
|
||||
s = sa;
|
||||
}
|
||||
else
|
||||
{
|
||||
l = i;
|
||||
if (e[i] == 0)
|
||||
{
|
||||
cdiv(- ra, - sa, w, q);
|
||||
H[i][n - 1] = cdivr;
|
||||
H[i][n] = cdivi;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = H[i][i + 1];
|
||||
y = H[i + 1][i];
|
||||
vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;
|
||||
vi = (d[i] - p) * 2.0m * q;
|
||||
if (vr == 0.0m & vi == 0.0m)
|
||||
{
|
||||
vr = eps * norm * (System.Math.Abs(w) + System.Math.Abs(q) + System.Math.Abs(x) + System.Math.Abs(y) + System.Math.Abs(z));
|
||||
}
|
||||
cdiv(x * r - z * ra + q * sa, x * s - z * sa - q * ra, vr, vi);
|
||||
H[i][n - 1] = cdivr;
|
||||
H[i][n] = cdivi;
|
||||
if (System.Math.Abs(x) > (System.Math.Abs(z) + System.Math.Abs(q)))
|
||||
{
|
||||
H[i + 1][n - 1] = (- ra - w * H[i][n - 1] + q * H[i][n]) / x;
|
||||
H[i + 1][n] = (- sa - w * H[i][n] - q * H[i][n - 1]) / x;
|
||||
}
|
||||
else
|
||||
{
|
||||
cdiv(- r - y * H[i][n - 1], - s - y * H[i][n], z, q);
|
||||
H[i + 1][n - 1] = cdivr;
|
||||
H[i + 1][n] = cdivi;
|
||||
}
|
||||
}
|
||||
|
||||
t = System.Math.Max(System.Math.Abs(H[i][n - 1]), System.Math.Abs(H[i][n]));
|
||||
if (t > 0 && (t > 1000000000000m || (eps * t) > 1m / t))
|
||||
{
|
||||
for (int j = i; j <= n; j++)
|
||||
{
|
||||
H[j][n - 1] = H[j][n - 1] / t;
|
||||
H[j][n] = H[j][n] / t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < nn; i++)
|
||||
{
|
||||
if (i < low | i > high)
|
||||
{
|
||||
for (int j = i; j < nn; j++)
|
||||
{
|
||||
V[i][j] = H[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = nn - 1; j >= low; j--)
|
||||
{
|
||||
for (int i = low; i <= high; i++)
|
||||
{
|
||||
z = 0.0m;
|
||||
for (int k = low; k <= System.Math.Min(j, high); k++)
|
||||
{
|
||||
z = z + V[i][k] * H[k][j];
|
||||
}
|
||||
V[i][j] = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EigenvalueDecomposition(GeneralMatrix Arg)
|
||||
{
|
||||
decimal[][] A = Arg.Array;
|
||||
n = Arg.ColumnDimension;
|
||||
V = new decimal[n][];
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
V[i] = new decimal[n];
|
||||
}
|
||||
d = new decimal[n];
|
||||
e = new decimal[n];
|
||||
|
||||
issymmetric = true;
|
||||
for (int j = 0; (j < n) & issymmetric; j++)
|
||||
{
|
||||
for (int i = 0; (i < n) & issymmetric; i++)
|
||||
{
|
||||
issymmetric = (A[i][j] == A[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (issymmetric)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
V[i][j] = A[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
tred2();
|
||||
tql2();
|
||||
}
|
||||
else
|
||||
{
|
||||
H = new decimal[n][];
|
||||
for (int i2 = 0; i2 < n; i2++)
|
||||
{
|
||||
H[i2] = new decimal[n];
|
||||
}
|
||||
ort = new decimal[n];
|
||||
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
H[i][j] = A[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
orthes();
|
||||
hqr2();
|
||||
}
|
||||
}
|
||||
|
||||
virtual public decimal[] RealEigenvalues
|
||||
{
|
||||
get
|
||||
{
|
||||
return d;
|
||||
}
|
||||
}
|
||||
virtual public decimal[] ImagEigenvalues
|
||||
{
|
||||
get
|
||||
{
|
||||
return e;
|
||||
}
|
||||
}
|
||||
virtual public GeneralMatrix D
|
||||
{
|
||||
get
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(n, n);
|
||||
decimal[][] D = X.Array;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
D[i][j] = 0.0m;
|
||||
}
|
||||
D[i][i] = d[i];
|
||||
if (e[i] > 0)
|
||||
{
|
||||
D[i][i + 1] = e[i];
|
||||
}
|
||||
else if (e[i] < 0)
|
||||
{
|
||||
D[i][i - 1] = e[i];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetV()
|
||||
{
|
||||
return new GeneralMatrix(V, n, n);
|
||||
}
|
||||
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,994 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
public enum Type { Variable, Value, UnaryOperator, Operator, Function, Result, Bracket, Comma, Error }
|
||||
|
||||
public struct Symbol
|
||||
{
|
||||
public string m_name;
|
||||
public decimal m_value;
|
||||
public Type m_type;
|
||||
public int m_argCount;
|
||||
public override string ToString()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate Symbol EvaluateFunctionDelegate(string name, params Symbol[] args);
|
||||
|
||||
public class Function
|
||||
{
|
||||
private static readonly HashSet<string> KnownFunctions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"sin", "cos", "tan", "cot", "cosh", "sinh", "tanh",
|
||||
"log", "ln", "logn", "sqrt", "cbrt", "abs",
|
||||
"acos", "asin", "atan", "atan2", "exp",
|
||||
"max", "min", "floor", "ceil", "round", "sign"
|
||||
};
|
||||
|
||||
public static bool UseRadians { get; set; } = true;
|
||||
|
||||
public decimal Result => m_result;
|
||||
public ArrayList Equation => (ArrayList)m_equation.Clone();
|
||||
public ArrayList Postfix => (ArrayList)m_postfix.Clone();
|
||||
|
||||
public EvaluateFunctionDelegate DefaultFunctionEvaluation
|
||||
{
|
||||
set => m_defaultFunctionEvaluation = value;
|
||||
}
|
||||
|
||||
public bool Error => m_bError;
|
||||
public string ErrorDescription => m_sErrorDescription;
|
||||
|
||||
public ArrayList Variables
|
||||
{
|
||||
get
|
||||
{
|
||||
ArrayList var = new ArrayList();
|
||||
foreach (Symbol sym in m_equation)
|
||||
{
|
||||
if ((sym.m_type == Type.Variable) && (!var.Contains(sym)))
|
||||
var.Add(sym);
|
||||
}
|
||||
return var;
|
||||
}
|
||||
set
|
||||
{
|
||||
foreach (Symbol sym in value)
|
||||
{
|
||||
for (int i = 0; i < m_postfix.Count; i++)
|
||||
{
|
||||
if ((sym.m_name == ((Symbol)m_postfix[i]).m_name) && (((Symbol)m_postfix[i]).m_type == Type.Variable))
|
||||
{
|
||||
Symbol sym1 = (Symbol)m_postfix[i];
|
||||
sym1.m_value = sym.m_value;
|
||||
m_postfix[i] = sym1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVariable(string name, decimal value)
|
||||
{
|
||||
for (int i = 0; i < m_postfix.Count; i++)
|
||||
{
|
||||
Symbol s = (Symbol)m_postfix[i];
|
||||
if (s.m_type == Type.Variable && string.Equals(s.m_name, name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
s.m_value = value;
|
||||
m_postfix[i] = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVariables(Dictionary<string, decimal> values)
|
||||
{
|
||||
for (int i = 0; i < m_postfix.Count; i++)
|
||||
{
|
||||
Symbol s = (Symbol)m_postfix[i];
|
||||
if (s.m_type == Type.Variable && values.TryGetValue(s.m_name, out decimal val))
|
||||
{
|
||||
s.m_value = val;
|
||||
m_postfix[i] = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Function()
|
||||
{
|
||||
}
|
||||
|
||||
private void AddSymbolWithImplicitMultiplication(Symbol sym)
|
||||
{
|
||||
if (m_equation.Count > 0)
|
||||
{
|
||||
Symbol prev = (Symbol)m_equation[m_equation.Count - 1];
|
||||
bool prevIsOperandOrClose = prev.m_type == Type.Value ||
|
||||
prev.m_type == Type.Variable ||
|
||||
prev.m_name == ")" || prev.m_name == "]" || prev.m_name == "}";
|
||||
|
||||
bool currIsOperandOrOpen = sym.m_type == Type.Value ||
|
||||
sym.m_type == Type.Variable ||
|
||||
sym.m_type == Type.Function ||
|
||||
sym.m_name == "(" || sym.m_name == "[" || sym.m_name == "{";
|
||||
|
||||
if (prevIsOperandOrClose && currIsOperandOrOpen)
|
||||
{
|
||||
Symbol mulSym = new Symbol
|
||||
{
|
||||
m_name = "*",
|
||||
m_value = 0,
|
||||
m_type = Type.Operator
|
||||
};
|
||||
m_equation.Add(mulSym);
|
||||
}
|
||||
}
|
||||
m_equation.Add(sym);
|
||||
}
|
||||
|
||||
public void Parse(string equation)
|
||||
{
|
||||
int state = 1;
|
||||
string temp = "";
|
||||
Symbol ctSymbol = new Symbol();
|
||||
|
||||
m_bError = false;
|
||||
m_sErrorDescription = "None";
|
||||
|
||||
m_equation.Clear();
|
||||
m_postfix.Clear();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(equation))
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = "Denklem boş olamaz.";
|
||||
return;
|
||||
}
|
||||
|
||||
// We process whitespace as delimiter without deleting it globally
|
||||
for (int i = 0; i < equation.Length; i++)
|
||||
{
|
||||
char ch = equation[i];
|
||||
switch (state)
|
||||
{
|
||||
case 1: // Neutral
|
||||
if (char.IsWhiteSpace(ch))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (char.IsDigit(ch) || ch == '.')
|
||||
{
|
||||
state = 2;
|
||||
temp += ch;
|
||||
}
|
||||
else if (char.IsLetter(ch))
|
||||
{
|
||||
state = 3;
|
||||
temp += ch;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctSymbol = ClassifyNonAlphanumeric(ch.ToString());
|
||||
AddSymbolWithImplicitMultiplication(ctSymbol);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // Reading Number
|
||||
if (char.IsDigit(ch) || ch == '.')
|
||||
{
|
||||
temp += ch;
|
||||
}
|
||||
else if (char.IsWhiteSpace(ch))
|
||||
{
|
||||
if (!EmitNumberSymbol(temp)) return;
|
||||
temp = "";
|
||||
state = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!EmitNumberSymbol(temp)) return;
|
||||
temp = "";
|
||||
|
||||
if (char.IsLetter(ch))
|
||||
{
|
||||
state = 3;
|
||||
temp += ch;
|
||||
}
|
||||
else
|
||||
{
|
||||
state = 1;
|
||||
ctSymbol = ClassifyNonAlphanumeric(ch.ToString());
|
||||
AddSymbolWithImplicitMultiplication(ctSymbol);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Reading Identifier
|
||||
if (char.IsLetterOrDigit(ch))
|
||||
{
|
||||
temp += ch;
|
||||
}
|
||||
else if (char.IsWhiteSpace(ch))
|
||||
{
|
||||
// Lookahead to see if next non-whitespace is '('
|
||||
bool nextIsOpen = false;
|
||||
for (int k = i + 1; k < equation.Length; k++)
|
||||
{
|
||||
if (!char.IsWhiteSpace(equation[k]))
|
||||
{
|
||||
nextIsOpen = (equation[k] == '(' || equation[k] == '[' || equation[k] == '{');
|
||||
break;
|
||||
}
|
||||
}
|
||||
EmitIdentifierSymbol(temp, nextIsOpen);
|
||||
temp = "";
|
||||
state = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
state = 1;
|
||||
EmitIdentifierSymbol(temp, ch == '(' || ch == '[' || ch == '{');
|
||||
temp = "";
|
||||
|
||||
ctSymbol = ClassifyNonAlphanumeric(ch.ToString());
|
||||
AddSymbolWithImplicitMultiplication(ctSymbol);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (temp != "")
|
||||
{
|
||||
if (state == 2)
|
||||
{
|
||||
if (!EmitNumberSymbol(temp)) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
EmitIdentifierSymbol(temp, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool EmitNumberSymbol(string temp)
|
||||
{
|
||||
if (!decimal.TryParse(temp, NumberStyles.Any, CultureInfo.InvariantCulture, out decimal val))
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = "Geçersiz sayı formatı: " + temp;
|
||||
return false;
|
||||
}
|
||||
|
||||
Symbol sym = new Symbol
|
||||
{
|
||||
m_name = temp,
|
||||
m_value = val,
|
||||
m_type = Type.Value
|
||||
};
|
||||
AddSymbolWithImplicitMultiplication(sym);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void EmitIdentifierSymbol(string temp, bool isNextOpenParen)
|
||||
{
|
||||
Symbol sym = new Symbol
|
||||
{
|
||||
m_name = temp,
|
||||
m_value = 0
|
||||
};
|
||||
|
||||
string lower = temp.ToLowerInvariant();
|
||||
if (lower == "pi")
|
||||
{
|
||||
sym.m_value = DecimalMath.PI;
|
||||
sym.m_type = Type.Value;
|
||||
}
|
||||
else if (lower == "e")
|
||||
{
|
||||
sym.m_value = DecimalMath.E;
|
||||
sym.m_type = Type.Value;
|
||||
}
|
||||
else if (isNextOpenParen)
|
||||
{
|
||||
if (temp.Length == 1 && (temp == "x" || temp == "y" || temp == "z" || temp == "t" || temp == "u" || temp == "v"))
|
||||
{
|
||||
sym.m_type = Type.Variable;
|
||||
}
|
||||
else
|
||||
{
|
||||
sym.m_type = Type.Function;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sym.m_type = Type.Variable;
|
||||
}
|
||||
AddSymbolWithImplicitMultiplication(sym);
|
||||
}
|
||||
|
||||
private Symbol ClassifyNonAlphanumeric(string token)
|
||||
{
|
||||
Symbol ctSymbol = new Symbol
|
||||
{
|
||||
m_name = token,
|
||||
m_value = 0
|
||||
};
|
||||
|
||||
switch (token)
|
||||
{
|
||||
case ",":
|
||||
case ";":
|
||||
ctSymbol.m_type = Type.Comma;
|
||||
break;
|
||||
case "(":
|
||||
case ")":
|
||||
case "[":
|
||||
case "]":
|
||||
case "{":
|
||||
case "}":
|
||||
ctSymbol.m_type = Type.Bracket;
|
||||
break;
|
||||
default:
|
||||
if (m_equation.Count == 0)
|
||||
{
|
||||
ctSymbol.m_type = Type.UnaryOperator;
|
||||
}
|
||||
else
|
||||
{
|
||||
Symbol prev = (Symbol)m_equation[m_equation.Count - 1];
|
||||
if (prev.m_type == Type.Value || prev.m_type == Type.Variable ||
|
||||
prev.m_name == ")" || prev.m_name == "]" || prev.m_name == "}")
|
||||
{
|
||||
ctSymbol.m_type = Type.Operator;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctSymbol.m_type = Type.UnaryOperator;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ctSymbol;
|
||||
}
|
||||
|
||||
public void Infix2Postfix()
|
||||
{
|
||||
m_postfix.Clear();
|
||||
Symbol tpSym;
|
||||
Stack tpStack = new Stack();
|
||||
Stack<int> fnArgCounts = new Stack<int>();
|
||||
|
||||
foreach (Symbol sym in m_equation)
|
||||
{
|
||||
if ((sym.m_type == Type.Value) || (sym.m_type == Type.Variable))
|
||||
m_postfix.Add(sym);
|
||||
else if (sym.m_type == Type.Function)
|
||||
{
|
||||
tpStack.Push(sym);
|
||||
fnArgCounts.Push(1);
|
||||
}
|
||||
else if ((sym.m_name == "(") || (sym.m_name == "[") || (sym.m_name == "{"))
|
||||
tpStack.Push(sym);
|
||||
else if (sym.m_type == Type.Comma)
|
||||
{
|
||||
while (tpStack.Count > 0)
|
||||
{
|
||||
tpSym = (Symbol)tpStack.Peek();
|
||||
if (tpSym.m_name == "(" || tpSym.m_name == "[" || tpSym.m_name == "{")
|
||||
break;
|
||||
m_postfix.Add(tpStack.Pop());
|
||||
}
|
||||
if (fnArgCounts.Count > 0)
|
||||
{
|
||||
int c = fnArgCounts.Pop();
|
||||
fnArgCounts.Push(c + 1);
|
||||
}
|
||||
}
|
||||
else if ((sym.m_name == ")") || (sym.m_name == "]") || (sym.m_name == "}"))
|
||||
{
|
||||
if (tpStack.Count > 0)
|
||||
{
|
||||
tpSym = (Symbol)tpStack.Pop();
|
||||
while ((tpSym.m_name != "(") && (tpSym.m_name != "[") && (tpSym.m_name != "{"))
|
||||
{
|
||||
m_postfix.Add(tpSym);
|
||||
if (tpStack.Count == 0) break;
|
||||
tpSym = (Symbol)tpStack.Pop();
|
||||
}
|
||||
|
||||
if (tpStack.Count > 0 && ((Symbol)tpStack.Peek()).m_type == Type.Function)
|
||||
{
|
||||
Symbol fn = (Symbol)tpStack.Pop();
|
||||
fn.m_argCount = fnArgCounts.Count > 0 ? fnArgCounts.Pop() : 1;
|
||||
m_postfix.Add(fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sym.m_type == Type.UnaryOperator)
|
||||
{
|
||||
// Unary operators (like unary - or +) modify the operand to their right.
|
||||
// They should never pop binary operators (^, *, /, +, -) from the stack.
|
||||
tpStack.Push(sym);
|
||||
}
|
||||
else if (sym.m_name == "^")
|
||||
{
|
||||
// Right-associative operator ^
|
||||
while (tpStack.Count > 0)
|
||||
{
|
||||
tpSym = (Symbol)tpStack.Peek();
|
||||
if ((tpSym.m_type == Type.Operator || tpSym.m_type == Type.Function) &&
|
||||
Precedence(tpSym) > Precedence(sym))
|
||||
{
|
||||
m_postfix.Add(tpStack.Pop());
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
tpStack.Push(sym);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (tpStack.Count > 0)
|
||||
{
|
||||
tpSym = (Symbol)tpStack.Peek();
|
||||
if (((tpSym.m_type == Type.UnaryOperator) || (tpSym.m_type == Type.Operator) || (tpSym.m_type == Type.Function)) &&
|
||||
(Precedence(tpSym) >= Precedence(sym)))
|
||||
{
|
||||
m_postfix.Add(tpStack.Pop());
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
tpStack.Push(sym);
|
||||
}
|
||||
}
|
||||
while (tpStack.Count > 0)
|
||||
{
|
||||
tpSym = (Symbol)tpStack.Pop();
|
||||
if (tpSym.m_type == Type.Function && tpSym.m_argCount == 0)
|
||||
{
|
||||
tpSym.m_argCount = fnArgCounts.Count > 0 ? fnArgCounts.Pop() : 1;
|
||||
}
|
||||
m_postfix.Add(tpSym);
|
||||
}
|
||||
}
|
||||
|
||||
public void EvaluatePostfix()
|
||||
{
|
||||
Symbol tpSym1, tpSym2, tpResult;
|
||||
Stack tpStack = new Stack();
|
||||
m_bError = false;
|
||||
foreach (Symbol sym in m_postfix)
|
||||
{
|
||||
if ((sym.m_type == Type.Value) || (sym.m_type == Type.Variable) || (sym.m_type == Type.Result))
|
||||
tpStack.Push(sym);
|
||||
else if (sym.m_type == Type.UnaryOperator)
|
||||
{
|
||||
if (tpStack.Count < 1)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = "Sözdizimi hatası (eksik operand).";
|
||||
return;
|
||||
}
|
||||
tpSym1 = (Symbol)tpStack.Pop();
|
||||
tpResult = Evaluate(sym, tpSym1);
|
||||
if (tpResult.m_type == Type.Error)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = tpResult.m_name;
|
||||
return;
|
||||
}
|
||||
tpStack.Push(tpResult);
|
||||
}
|
||||
else if (sym.m_type == Type.Operator)
|
||||
{
|
||||
if (tpStack.Count < 2)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = "Sözdizimi hatası (eksik operand).";
|
||||
return;
|
||||
}
|
||||
tpSym1 = (Symbol)tpStack.Pop();
|
||||
tpSym2 = (Symbol)tpStack.Pop();
|
||||
tpResult = Evaluate(tpSym2, sym, tpSym1);
|
||||
if (tpResult.m_type == Type.Error)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = tpResult.m_name;
|
||||
return;
|
||||
}
|
||||
tpStack.Push(tpResult);
|
||||
}
|
||||
else if (sym.m_type == Type.Function)
|
||||
{
|
||||
int count = sym.m_argCount > 0 ? sym.m_argCount : 1;
|
||||
if (tpStack.Count < count)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = $"Fonksiyon '{sym.m_name}' için argüman eksik.";
|
||||
return;
|
||||
}
|
||||
|
||||
Symbol[] fnParam = new Symbol[count];
|
||||
for (int i = count - 1; i >= 0; i--)
|
||||
{
|
||||
fnParam[i] = (Symbol)tpStack.Pop();
|
||||
}
|
||||
|
||||
tpResult = EvaluateFunction(sym.m_name, fnParam);
|
||||
if (tpResult.m_type == Type.Error)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = tpResult.m_name;
|
||||
return;
|
||||
}
|
||||
tpStack.Push(tpResult);
|
||||
}
|
||||
}
|
||||
if (tpStack.Count == 1)
|
||||
{
|
||||
tpResult = (Symbol)tpStack.Pop();
|
||||
m_result = tpResult.m_value;
|
||||
}
|
||||
else if (tpStack.Count > 1)
|
||||
{
|
||||
m_bError = true;
|
||||
m_sErrorDescription = "İfade tam çözümlenemedi (fazla terim).";
|
||||
}
|
||||
}
|
||||
|
||||
protected int Precedence(Symbol sym)
|
||||
{
|
||||
switch (sym.m_type)
|
||||
{
|
||||
case Type.Bracket:
|
||||
return 7;
|
||||
case Type.Function:
|
||||
return 6;
|
||||
case Type.UnaryOperator:
|
||||
return 3;
|
||||
case Type.Comma:
|
||||
return 0;
|
||||
}
|
||||
switch (sym.m_name)
|
||||
{
|
||||
case "^":
|
||||
return 5;
|
||||
case "/":
|
||||
case "*":
|
||||
case "%":
|
||||
return 2;
|
||||
case "+":
|
||||
case "-":
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected Symbol Evaluate(Symbol opr, Symbol sym1)
|
||||
{
|
||||
Symbol result = default;
|
||||
result.m_name = opr.m_name + sym1.m_name;
|
||||
result.m_type = Type.Result;
|
||||
result.m_value = 0;
|
||||
switch (opr.m_name)
|
||||
{
|
||||
case "+":
|
||||
result.m_value = sym1.m_value;
|
||||
break;
|
||||
case "-":
|
||||
result.m_value = -1 * sym1.m_value;
|
||||
break;
|
||||
default:
|
||||
result.m_type = Type.Error;
|
||||
result.m_name = "Tanımsız tekli operatör: " + opr.m_name;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected Symbol Evaluate(Symbol sym1, Symbol opr, Symbol sym2)
|
||||
{
|
||||
Symbol result = default;
|
||||
result.m_name = sym1.m_name + opr.m_name + sym2.m_name;
|
||||
result.m_type = Type.Result;
|
||||
result.m_value = 0;
|
||||
try
|
||||
{
|
||||
switch (opr.m_name)
|
||||
{
|
||||
case "^":
|
||||
result.m_value = DecimalMath.Pow(sym1.m_value, sym2.m_value);
|
||||
break;
|
||||
case "/":
|
||||
if (sym2.m_value != 0)
|
||||
result.m_value = sym1.m_value / sym2.m_value;
|
||||
else
|
||||
{
|
||||
result.m_name = "Sıfıra bölme hatası (Divide by Zero).";
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "*":
|
||||
result.m_value = sym1.m_value * sym2.m_value;
|
||||
break;
|
||||
case "%":
|
||||
if (sym2.m_value != 0)
|
||||
result.m_value = sym1.m_value % sym2.m_value;
|
||||
else
|
||||
{
|
||||
result.m_name = "Sıfıra göre mod alınamaz.";
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "+":
|
||||
result.m_value = sym1.m_value + sym2.m_value;
|
||||
break;
|
||||
case "-":
|
||||
result.m_value = sym1.m_value - sym2.m_value;
|
||||
break;
|
||||
default:
|
||||
result.m_type = Type.Error;
|
||||
result.m_name = "Tanımsız operatör: " + opr.m_name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.m_type = Type.Error;
|
||||
result.m_name = ex.Message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected Symbol EvaluateFunction(string name, params Symbol[] args)
|
||||
{
|
||||
Symbol result = default;
|
||||
result.m_name = "";
|
||||
result.m_type = Type.Result;
|
||||
result.m_value = 0;
|
||||
|
||||
string lowerName = name.ToLowerInvariant();
|
||||
decimal angleFactor = UseRadians ? 1.0m : (DecimalMath.PI / 180.0m);
|
||||
decimal invAngleFactor = UseRadians ? 1.0m : (180.0m / DecimalMath.PI);
|
||||
|
||||
try
|
||||
{
|
||||
switch (lowerName)
|
||||
{
|
||||
case "cos":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Cos(v * angleFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "sin":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Sin(v * angleFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "tan":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Tan(v * angleFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "cot":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
decimal sinVal = DecimalMath.Sin(v * angleFactor);
|
||||
if (DecimalMath.Abs(sinVal) <= 1e-25m)
|
||||
{
|
||||
result.m_name = "Cot(x) bu noktada tanımsızdır (sin(x) = 0).";
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_value = DecimalMath.Cos(v * angleFactor) / sinVal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "cosh":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Cosh(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "sinh":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Sinh(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "tanh":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Tanh(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "log":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Log10(v);
|
||||
}
|
||||
else if (args.Length == 2)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
decimal b = ((Symbol)args[1]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + "," + b.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Log(v) / DecimalMath.Log(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "ln":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Log(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "logn":
|
||||
if (args.Length == 2)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
decimal b = ((Symbol)args[1]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + "," + b.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Log(v) / DecimalMath.Log(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "sqrt":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Sqrt(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "cbrt":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = v < 0 ? -DecimalMath.Pow(-v, 1m / 3m) : DecimalMath.Pow(v, 1m / 3m);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "abs":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Abs(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "acos":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Acos(v) * invAngleFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "asin":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Asin(v) * invAngleFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "atan":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Atan(v) * invAngleFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "atan2":
|
||||
if (args.Length == 2)
|
||||
{
|
||||
decimal y = ((Symbol)args[0]).m_value;
|
||||
decimal x = ((Symbol)args[1]).m_value;
|
||||
result.m_name = name + "(" + y.ToString(CultureInfo.InvariantCulture) + "," + x.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Atan2(y, x) * invAngleFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: atan2(y, x)";
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "exp":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
decimal v = ((Symbol)args[0]).m_value;
|
||||
result.m_name = name + "(" + v.ToString(CultureInfo.InvariantCulture) + ")";
|
||||
result.m_value = DecimalMath.Exp(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "max":
|
||||
if (args.Length == 2)
|
||||
{
|
||||
decimal a = ((Symbol)args[0]).m_value;
|
||||
decimal b = ((Symbol)args[1]).m_value;
|
||||
result.m_value = Math.Max(a, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: max(a, b)";
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "min":
|
||||
if (args.Length == 2)
|
||||
{
|
||||
decimal a = ((Symbol)args[0]).m_value;
|
||||
decimal b = ((Symbol)args[1]).m_value;
|
||||
result.m_value = Math.Min(a, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.m_name = "Geçersiz parametre sayısı: min(a, b)";
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
case "floor":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
result.m_value = decimal.Floor(((Symbol)args[0]).m_value);
|
||||
}
|
||||
break;
|
||||
case "ceil":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
result.m_value = decimal.Ceiling(((Symbol)args[0]).m_value);
|
||||
}
|
||||
break;
|
||||
case "round":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
result.m_value = decimal.Round(((Symbol)args[0]).m_value);
|
||||
}
|
||||
break;
|
||||
case "sign":
|
||||
if (args.Length == 1)
|
||||
{
|
||||
result.m_value = DecimalMath.Sign(((Symbol)args[0]).m_value);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (m_defaultFunctionEvaluation != null)
|
||||
result = m_defaultFunctionEvaluation(name, args);
|
||||
else
|
||||
{
|
||||
result.m_name = "Fonksiyon bulunamadı: " + name;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.m_name = ex.Message;
|
||||
result.m_type = Type.Error;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected bool m_bError = false;
|
||||
protected string m_sErrorDescription = "None";
|
||||
public decimal m_result = 0;
|
||||
public ArrayList m_equation = new ArrayList();
|
||||
public ArrayList m_postfix = new ArrayList();
|
||||
protected EvaluateFunctionDelegate m_defaultFunctionEvaluation;
|
||||
}
|
||||
|
|
@ -1,767 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DotNetMatrix
|
||||
{
|
||||
internal class Maths
|
||||
{
|
||||
public static decimal Hypot(decimal a, decimal b)
|
||||
{
|
||||
decimal r;
|
||||
if (Math.Abs(a) > Math.Abs(b))
|
||||
{
|
||||
r = b/a;
|
||||
r = Math.Abs(a) * (decimal)DecimalMath.Sqrt(1 + r * r);
|
||||
}
|
||||
else if (b != 0)
|
||||
{
|
||||
r = a/b;
|
||||
r = Math.Abs(b) * (decimal)DecimalMath.Sqrt(1 + r * r);
|
||||
}
|
||||
else
|
||||
{
|
||||
r = 0.0m;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class GeneralMatrix : System.ICloneable, System.Runtime.Serialization.ISerializable, System.IDisposable
|
||||
{
|
||||
private decimal[][] A;
|
||||
private int m, n;
|
||||
|
||||
public GeneralMatrix(int m, int n)
|
||||
{
|
||||
this.m = m;
|
||||
this.n = n;
|
||||
A = new decimal[m][];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
A[i] = new decimal[n];
|
||||
}
|
||||
}
|
||||
|
||||
public GeneralMatrix(int m, int n, decimal s)
|
||||
{
|
||||
this.m = m;
|
||||
this.n = n;
|
||||
A = new decimal[m][];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
A[i] = new decimal[n];
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GeneralMatrix(decimal[][] A)
|
||||
{
|
||||
m = A.Length;
|
||||
n = A[0].Length;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
if (A[i].Length != n)
|
||||
{
|
||||
throw new System.ArgumentException("All rows must have the same length.");
|
||||
}
|
||||
}
|
||||
this.A = A;
|
||||
}
|
||||
|
||||
public GeneralMatrix(decimal[][] A, int m, int n)
|
||||
{
|
||||
this.A = A;
|
||||
this.m = m;
|
||||
this.n = n;
|
||||
}
|
||||
|
||||
public GeneralMatrix(decimal[] vals, int m)
|
||||
{
|
||||
this.m = m;
|
||||
n = (m != 0?vals.Length / m:0);
|
||||
if (m * n != vals.Length)
|
||||
{
|
||||
throw new System.ArgumentException("Array length must be a multiple of m.");
|
||||
}
|
||||
A = new decimal[m][];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
A[i] = new decimal[n];
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = vals[i + j * m];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual decimal[][] Array
|
||||
{
|
||||
get
|
||||
{
|
||||
return A;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual decimal[][] ArrayCopy
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal[][] C = new decimal[m][];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
C[i] = new decimal[n];
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j];
|
||||
}
|
||||
}
|
||||
return C;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual decimal[] ColumnPackedCopy
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal[] vals = new decimal[m * n];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
vals[i + j * m] = A[i][j];
|
||||
}
|
||||
}
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual decimal[] RowPackedCopy
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal[] vals = new decimal[m * n];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
vals[i * n + j] = A[i][j];
|
||||
}
|
||||
}
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int RowDimension
|
||||
{
|
||||
get
|
||||
{
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int ColumnDimension
|
||||
{
|
||||
get
|
||||
{
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
public static GeneralMatrix ConstructWithCopy(decimal[][] A)
|
||||
{
|
||||
int m = A.Length;
|
||||
int n = A[0].Length;
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
if (A[i].Length != n)
|
||||
{
|
||||
throw new System.ArgumentException("All rows must have the same length.");
|
||||
}
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Copy()
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual decimal GetElement(int i, int j)
|
||||
{
|
||||
return A[i][j];
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetMatrix(int i0, int i1, int j0, int j1)
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(i1 - i0 + 1, j1 - j0 + 1);
|
||||
decimal[][] B = X.Array;
|
||||
try
|
||||
{
|
||||
for (int i = i0; i <= i1; i++)
|
||||
{
|
||||
for (int j = j0; j <= j1; j++)
|
||||
{
|
||||
B[i - i0][j - j0] = A[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetMatrix(int[] r, int[] c)
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(r.Length, c.Length);
|
||||
decimal[][] B = X.Array;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < r.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < c.Length; j++)
|
||||
{
|
||||
B[i][j] = A[r[i]][c[j]];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetMatrix(int i0, int i1, int[] c)
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(i1 - i0 + 1, c.Length);
|
||||
decimal[][] B = X.Array;
|
||||
try
|
||||
{
|
||||
for (int i = i0; i <= i1; i++)
|
||||
{
|
||||
for (int j = 0; j < c.Length; j++)
|
||||
{
|
||||
B[i - i0][j] = A[i][c[j]];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetMatrix(int[] r, int j0, int j1)
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(r.Length, j1 - j0 + 1);
|
||||
decimal[][] B = X.Array;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < r.Length; i++)
|
||||
{
|
||||
for (int j = j0; j <= j1; j++)
|
||||
{
|
||||
B[i][j - j0] = A[r[i]][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual void SetElement(int i, int j, decimal s)
|
||||
{
|
||||
A[i][j] = s;
|
||||
}
|
||||
|
||||
public virtual void SetMatrix(int i0, int i1, int j0, int j1, GeneralMatrix X)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = i0; i <= i1; i++)
|
||||
{
|
||||
for (int j = j0; j <= j1; j++)
|
||||
{
|
||||
A[i][j] = X.GetElement(i - i0, j - j0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetMatrix(int[] r, int[] c, GeneralMatrix X)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < r.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < c.Length; j++)
|
||||
{
|
||||
A[r[i]][c[j]] = X.GetElement(i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetMatrix(int[] r, int j0, int j1, GeneralMatrix X)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < r.Length; i++)
|
||||
{
|
||||
for (int j = j0; j <= j1; j++)
|
||||
{
|
||||
A[r[i]][j] = X.GetElement(i, j - j0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetMatrix(int i0, int i1, int[] c, GeneralMatrix X)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = i0; i <= i1; i++)
|
||||
{
|
||||
for (int j = 0; j < c.Length; j++)
|
||||
{
|
||||
A[i][c[j]] = X.GetElement(i - i0, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.IndexOutOfRangeException e)
|
||||
{
|
||||
throw new System.IndexOutOfRangeException("Submatrix indices", e);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Transpose()
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(n, m);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[j][i] = A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual decimal Norm1()
|
||||
{
|
||||
decimal f = 0;
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
decimal s = 0;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
s += System.Math.Abs(A[i][j]);
|
||||
}
|
||||
f = System.Math.Max(f, s);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
public virtual decimal NormInf()
|
||||
{
|
||||
decimal f = 0;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
decimal s = 0;
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
s += System.Math.Abs(A[i][j]);
|
||||
}
|
||||
f = System.Math.Max(f, s);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
public virtual decimal NormF()
|
||||
{
|
||||
decimal f = 0;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
f = Maths.Hypot(f, A[i][j]);
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix UnaryMinus()
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = - A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Add(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j] + B.A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix AddEquals(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = A[i][j] + B.A[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Subtract(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j] - B.A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix SubtractEquals(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = A[i][j] - B.A[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix ArrayMultiply(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j] * B.A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix ArrayMultiplyEquals(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = A[i][j] * B.A[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix ArrayRightDivide(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = A[i][j] / B.A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix ArrayRightDivideEquals(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = A[i][j] / B.A[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix ArrayLeftDivide(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = B.A[i][j] / A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix ArrayLeftDivideEquals(GeneralMatrix B)
|
||||
{
|
||||
CheckMatrixDimensions(B);
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = B.A[i][j] / A[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Multiply(decimal s)
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] C = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
C[i][j] = s * A[i][j];
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix MultiplyEquals(decimal s)
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
A[i][j] = s * A[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Multiply(GeneralMatrix B)
|
||||
{
|
||||
if (B.m != n)
|
||||
{
|
||||
throw new System.ArgumentException("GeneralMatrix inner dimensions must agree.");
|
||||
}
|
||||
GeneralMatrix X = new GeneralMatrix(m, B.n);
|
||||
decimal[][] C = X.Array;
|
||||
decimal[] Bcolj = new decimal[n];
|
||||
for (int j = 0; j < B.n; j++)
|
||||
{
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
Bcolj[k] = B.A[k][j];
|
||||
}
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
decimal[] Arowi = A[i];
|
||||
decimal s = 0;
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
s += Arowi[k] * Bcolj[k];
|
||||
}
|
||||
C[i][j] = s;
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
public static GeneralMatrix operator +(GeneralMatrix m1, GeneralMatrix m2)
|
||||
{
|
||||
return m1.Add(m2);
|
||||
}
|
||||
|
||||
public static GeneralMatrix operator -(GeneralMatrix m1, GeneralMatrix m2)
|
||||
{
|
||||
return m1.Subtract(m2);
|
||||
}
|
||||
|
||||
public static GeneralMatrix operator *(GeneralMatrix m1, GeneralMatrix m2)
|
||||
{
|
||||
return m1.Multiply(m2);
|
||||
}
|
||||
|
||||
public virtual LUDecomposition LUD()
|
||||
{
|
||||
return new LUDecomposition(this);
|
||||
}
|
||||
|
||||
public virtual QRDecomposition QRD()
|
||||
{
|
||||
return new QRDecomposition(this);
|
||||
}
|
||||
|
||||
public virtual CholeskyDecomposition chol()
|
||||
{
|
||||
return new CholeskyDecomposition(this);
|
||||
}
|
||||
|
||||
public virtual SingularValueDecomposition SVD()
|
||||
{
|
||||
return new SingularValueDecomposition(this);
|
||||
}
|
||||
|
||||
public virtual EigenvalueDecomposition Eigen()
|
||||
{
|
||||
return new EigenvalueDecomposition(this);
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Solve(GeneralMatrix B)
|
||||
{
|
||||
return (m == n ? (new LUDecomposition(this)).Solve(B):(new QRDecomposition(this)).Solve(B));
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix SolveTranspose(GeneralMatrix B)
|
||||
{
|
||||
return Transpose().Solve(B.Transpose());
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix Inverse()
|
||||
{
|
||||
return Solve(Identity(m, m));
|
||||
}
|
||||
|
||||
public virtual decimal Determinant()
|
||||
{
|
||||
return new LUDecomposition(this).Determinant();
|
||||
}
|
||||
|
||||
public virtual int Rank()
|
||||
{
|
||||
return new SingularValueDecomposition(this).Rank();
|
||||
}
|
||||
|
||||
public virtual decimal Condition()
|
||||
{
|
||||
return new SingularValueDecomposition(this).Condition();
|
||||
}
|
||||
|
||||
public virtual decimal Trace()
|
||||
{
|
||||
decimal t = 0;
|
||||
for (int i = 0; i < System.Math.Min(m, n); i++)
|
||||
{
|
||||
t += A[i][i];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
public static GeneralMatrix Identity(int m, int n)
|
||||
{
|
||||
GeneralMatrix A = new GeneralMatrix(m, n);
|
||||
decimal[][] X = A.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
X[i][j] = (i == j ? 1.0m : 0.0m);
|
||||
}
|
||||
}
|
||||
return A;
|
||||
}
|
||||
|
||||
private void CheckMatrixDimensions(GeneralMatrix B)
|
||||
{
|
||||
if (B.m != m || B.n != n)
|
||||
{
|
||||
throw new System.ArgumentException("GeneralMatrix dimensions must agree.");
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
~GeneralMatrix()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
public System.Object Clone()
|
||||
{
|
||||
return this.Copy();
|
||||
}
|
||||
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,322 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DotNetMatrix
|
||||
{
|
||||
|
||||
/// <summary>LU Decomposition.
|
||||
/// For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n
|
||||
/// unit lower triangular matrix L, an n-by-n upper triangular matrix U,
|
||||
/// and a permutation vector piv of length m so that A(piv,:) = L*U.
|
||||
/// <code> If m < n, then L is m-by-m and U is m-by-n. </code>
|
||||
/// The LU decompostion with pivoting always exists, even if the matrix is
|
||||
/// singular, so the constructor will never fail. The primary use of the
|
||||
/// LU decomposition is in the solution of square systems of simultaneous
|
||||
/// linear equations. This will fail if IsNonSingular() returns false.
|
||||
/// </summary>
|
||||
|
||||
[Serializable]
|
||||
public class LUDecomposition : System.Runtime.Serialization.ISerializable
|
||||
{
|
||||
#region Class variables
|
||||
|
||||
/// <summary>Array for internal storage of decomposition.
|
||||
/// @serial internal array storage.
|
||||
/// </summary>
|
||||
private decimal[][] LU;
|
||||
|
||||
/// <summary>Row and column dimensions, and pivot sign.
|
||||
/// @serial column dimension.
|
||||
/// @serial row dimension.
|
||||
/// @serial pivot sign.
|
||||
/// </summary>
|
||||
private int m, n, pivsign;
|
||||
|
||||
/// <summary>Internal storage of pivot vector.
|
||||
/// @serial pivot vector.
|
||||
/// </summary>
|
||||
private int[] piv;
|
||||
|
||||
#endregion // Class variables
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>LU Decomposition</summary>
|
||||
/// <param name="A"> Rectangular matrix
|
||||
/// </param>
|
||||
/// <returns> Structure to access L, U and piv.
|
||||
/// </returns>
|
||||
|
||||
public LUDecomposition(GeneralMatrix A)
|
||||
{
|
||||
// Use a "left-looking", dot-product, Crout/Doolittle algorithm.
|
||||
|
||||
LU = A.ArrayCopy;
|
||||
m = A.RowDimension;
|
||||
n = A.ColumnDimension;
|
||||
piv = new int[m];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
piv[i] = i;
|
||||
}
|
||||
pivsign = 1;
|
||||
decimal[] LUrowi;
|
||||
decimal[] LUcolj = new decimal[m];
|
||||
|
||||
// Outer loop.
|
||||
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
|
||||
// Make a copy of the j-th column to localize references.
|
||||
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
LUcolj[i] = LU[i][j];
|
||||
}
|
||||
|
||||
// Apply previous transformations.
|
||||
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
LUrowi = LU[i];
|
||||
|
||||
// Most of the time is spent in the following dot product.
|
||||
|
||||
int kmax = System.Math.Min(i, j);
|
||||
decimal s = 0.0m;
|
||||
for (int k = 0; k < kmax; k++)
|
||||
{
|
||||
s += LUrowi[k] * LUcolj[k];
|
||||
}
|
||||
|
||||
LUrowi[j] = LUcolj[i] -= s;
|
||||
}
|
||||
|
||||
// Find pivot and exchange if necessary.
|
||||
|
||||
int p = j;
|
||||
for (int i = j + 1; i < m; i++)
|
||||
{
|
||||
if (System.Math.Abs(LUcolj[i]) > System.Math.Abs(LUcolj[p]))
|
||||
{
|
||||
p = i;
|
||||
}
|
||||
}
|
||||
if (p != j)
|
||||
{
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
decimal t = LU[p][k]; LU[p][k] = LU[j][k]; LU[j][k] = t;
|
||||
}
|
||||
int k2 = piv[p]; piv[p] = piv[j]; piv[j] = k2;
|
||||
pivsign = - pivsign;
|
||||
}
|
||||
|
||||
// Compute multipliers.
|
||||
|
||||
if (j < m & LU[j][j] != 0.0m)
|
||||
{
|
||||
for (int i = j + 1; i < m; i++)
|
||||
{
|
||||
LU[i][j] /= LU[j][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion // Constructor
|
||||
|
||||
#region Public Properties
|
||||
/// <summary>Is the matrix nonsingular?</summary>
|
||||
/// <returns> true if U, and hence A, is nonsingular.
|
||||
/// </returns>
|
||||
virtual public bool IsNonSingular
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (LU[j][j] == 0)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Return lower triangular factor</summary>
|
||||
/// <returns> L
|
||||
/// </returns>
|
||||
virtual public GeneralMatrix L
|
||||
{
|
||||
get
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] L = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (i > j)
|
||||
{
|
||||
L[i][j] = LU[i][j];
|
||||
}
|
||||
else if (i == j)
|
||||
{
|
||||
L[i][j] = 1.0m;
|
||||
}
|
||||
else
|
||||
{
|
||||
L[i][j] = 0.0m;
|
||||
}
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Return upper triangular factor</summary>
|
||||
/// <returns> U
|
||||
/// </returns>
|
||||
virtual public GeneralMatrix U
|
||||
{
|
||||
get
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(n, n);
|
||||
decimal[][] U = X.Array;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (i <= j)
|
||||
{
|
||||
U[i][j] = LU[i][j];
|
||||
}
|
||||
else
|
||||
{
|
||||
U[i][j] = 0.0m;
|
||||
}
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Return pivot permutation vector</summary>
|
||||
/// <returns> piv
|
||||
/// </returns>
|
||||
virtual public int[] Pivot
|
||||
{
|
||||
get
|
||||
{
|
||||
int[] p = new int[m];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
p[i] = piv[i];
|
||||
}
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Return pivot permutation vector as a one-dimensional decimal array</summary>
|
||||
/// <returns> (decimal) piv
|
||||
/// </returns>
|
||||
virtual public decimal[] decimalPivot
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal[] vals = new decimal[m];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
vals[i] = (decimal) piv[i];
|
||||
}
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>Determinant</summary>
|
||||
/// <returns> det(A)
|
||||
/// </returns>
|
||||
/// <exception cref="System.ArgumentException"> Matrix must be square
|
||||
/// </exception>
|
||||
|
||||
public virtual decimal Determinant()
|
||||
{
|
||||
if (m != n)
|
||||
{
|
||||
throw new System.ArgumentException("Matrix must be square.");
|
||||
}
|
||||
decimal d = (decimal) pivsign;
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
d *= LU[j][j];
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
/// <summary>Solve A*X = B</summary>
|
||||
/// <param name="B"> A Matrix with as many rows as A and any number of columns.
|
||||
/// </param>
|
||||
/// <returns> X so that L*U*X = B(piv,:)
|
||||
/// </returns>
|
||||
/// <exception cref="System.ArgumentException"> Matrix row dimensions must agree.
|
||||
/// </exception>
|
||||
/// <exception cref="System.SystemException"> Matrix is singular.
|
||||
/// </exception>
|
||||
|
||||
public virtual GeneralMatrix Solve(GeneralMatrix B)
|
||||
{
|
||||
if (B.RowDimension != m)
|
||||
{
|
||||
throw new System.ArgumentException("Matrix row dimensions must agree.");
|
||||
}
|
||||
if (!this.IsNonSingular)
|
||||
{
|
||||
throw new System.SystemException("Matrix is singular.");
|
||||
}
|
||||
|
||||
// Copy right hand side with pivoting
|
||||
int nx = B.ColumnDimension;
|
||||
GeneralMatrix Xmat = B.GetMatrix(piv, 0, nx - 1);
|
||||
decimal[][] X = Xmat.Array;
|
||||
|
||||
// Solve L*Y = B(piv,:)
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[i][j] -= X[k][j] * LU[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Solve U*X = Y;
|
||||
for (int k = n - 1; k >= 0; k--)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[k][j] /= LU[k][k];
|
||||
}
|
||||
for (int i = 0; i < k; i++)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[i][j] -= X[k][j] * LU[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
return Xmat;
|
||||
}
|
||||
|
||||
#endregion // Public Methods
|
||||
|
||||
// A method called when serializing this class.
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,207 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using DotNetMatrix;
|
||||
|
||||
public class Matrix
|
||||
{
|
||||
private static Random random = new Random();
|
||||
|
||||
public static decimal[][] GenerateRandomMatrix(int rows, int columns, decimal min, decimal max)
|
||||
{
|
||||
decimal[][] res = new decimal[rows][];
|
||||
for (int i = 0; i < rows; i++)
|
||||
{
|
||||
res[i] = new decimal[columns];
|
||||
for (int j = 0; j < columns; j++)
|
||||
{
|
||||
double range = (double)(max - min);
|
||||
double sample = random.NextDouble();
|
||||
double scaled = (sample * range) + (double)min;
|
||||
decimal value = (decimal)System.Math.Round(scaled, 2);
|
||||
res[i][j] = value;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static decimal[][] Transpoze(decimal[][] _m)
|
||||
{
|
||||
if (_m == null || _m.Length == 0) return new decimal[0][];
|
||||
decimal[][] res = new decimal[_m[0].Length][];
|
||||
for (int i = 0; i < _m[0].Length; i++)
|
||||
{
|
||||
res[i] = new decimal[_m.Length];
|
||||
}
|
||||
for (int i = 0; i < _m.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < _m[0].Length; j++)
|
||||
{
|
||||
res[j][i] = _m[i][j];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static decimal MatrixDeterminant(decimal[][] _m)
|
||||
{
|
||||
if (_m == null || _m.Length == 0) return 0;
|
||||
if (_m.Length != _m[0].Length)
|
||||
{
|
||||
throw new ArgumentException("Determinant hesabı için matris kare (N x N) olmalıdır.");
|
||||
}
|
||||
|
||||
int n = _m.Length;
|
||||
if (n == 1) return _m[0][0];
|
||||
if (n == 2) return _m[0][0] * _m[1][1] - _m[0][1] * _m[1][0];
|
||||
|
||||
// Use O(n^3) LU Decomposition instead of O(n!) recursive Laplace expansion
|
||||
GeneralMatrix gm = GeneralMatrix.ConstructWithCopy(_m);
|
||||
return gm.Determinant();
|
||||
}
|
||||
|
||||
public static decimal[] SolveEquation(decimal[][] _m, decimal[] _v)
|
||||
{
|
||||
if (_m == null || _v == null || _m.Length == 0) return new decimal[0];
|
||||
int len = _m.Length;
|
||||
|
||||
GeneralMatrix A = GeneralMatrix.ConstructWithCopy(_m);
|
||||
GeneralMatrix b = new GeneralMatrix(len, 1);
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
b.Array[i][0] = _v[i];
|
||||
}
|
||||
|
||||
GeneralMatrix x = A.Solve(b);
|
||||
decimal[] res = new decimal[len];
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
res[i] = x.Array[i][0];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static decimal[][] ConvertLinearEquationsToMatrix(List<string> equations, List<string> variables)
|
||||
{
|
||||
if (equations == null || variables == null || equations.Count != variables.Count) return null;
|
||||
|
||||
int n = equations.Count;
|
||||
decimal[][] res = new decimal[n][];
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
res[i] = new decimal[n];
|
||||
string eq = equations[i];
|
||||
if (eq.Contains("="))
|
||||
{
|
||||
string[] parts = eq.Split('=');
|
||||
eq = parts[0] + "-(" + parts[1] + ")";
|
||||
}
|
||||
|
||||
// Use numerical evaluation to extract exact linear coefficients reliably:
|
||||
// f(0, 0, ...) = c
|
||||
// f(0, ..., x_k=1, ..., 0) - c = coeff_k
|
||||
Dictionary<string, decimal> zeroPts = new Dictionary<string, decimal>();
|
||||
foreach (string v in variables) zeroPts[v] = 0m;
|
||||
|
||||
decimal f0 = NumericalMethods.MethodMultiVar_EvaluateFunction(eq, zeroPts);
|
||||
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
string varName = variables[k];
|
||||
zeroPts[varName] = 1m;
|
||||
decimal f1 = NumericalMethods.MethodMultiVar_EvaluateFunction(eq, zeroPts);
|
||||
res[i][k] = f1 - f0;
|
||||
zeroPts[varName] = 0m;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static decimal[][] MatrixMultiplication(decimal[][] _m1, decimal[][] _m2)
|
||||
{
|
||||
if (_m1 == null || _m2 == null || _m1.Length == 0 || _m2.Length == 0) return null;
|
||||
if (_m1[0].Length == _m2.Length)
|
||||
{
|
||||
decimal[][] res = new decimal[_m1.Length][];
|
||||
for (int i = 0; i < _m1.Length; i++)
|
||||
{
|
||||
res[i] = new decimal[_m2[0].Length];
|
||||
}
|
||||
|
||||
for (int i = 0; i < res.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < res[0].Length; j++)
|
||||
{
|
||||
decimal sum = 0;
|
||||
for (int k = 0; k < _m2.Length; k++)
|
||||
{
|
||||
sum += _m1[i][k] * _m2[k][j];
|
||||
}
|
||||
res[i][j] = sum;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Birinci matrisin sütun sayısı ile ikinci matrisin satır sayısı eşit olmalıdır.");
|
||||
}
|
||||
}
|
||||
|
||||
public static decimal[][] MatrixMultiplication(decimal[][] _m, decimal _c)
|
||||
{
|
||||
if (_m == null) return null;
|
||||
decimal[][] res = new decimal[_m.Length][];
|
||||
for (int i = 0; i < _m.Length; i++)
|
||||
{
|
||||
res[i] = new decimal[_m[i].Length];
|
||||
for (int j = 0; j < _m[i].Length; j++)
|
||||
{
|
||||
res[i][j] = _m[i][j] * _c;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static decimal[] TurnListToVector(List<decimal> _vec)
|
||||
{
|
||||
return _vec.ToArray();
|
||||
}
|
||||
|
||||
public static decimal[][] TurnListToMatrix(List<List<decimal>> _m)
|
||||
{
|
||||
decimal[][] res = new decimal[_m.Count][];
|
||||
for (int i = 0; i < _m.Count; i++)
|
||||
{
|
||||
res[i] = _m[i].ToArray();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static string DebugMatrix(decimal[][] _m, string _sep = "\t")
|
||||
{
|
||||
if (_m == null || _m.Length == 0) return "";
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
for (int i = 0; i < _m.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < _m[i].Length; j++)
|
||||
{
|
||||
sb.Append(_m[i][j].ToString("0.######", CultureInfo.InvariantCulture));
|
||||
sb.Append(j == _m[i].Length - 1 ? Environment.NewLine : _sep);
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string DebugVector(decimal[] _v, string _sep = " ")
|
||||
{
|
||||
if (_v == null) return "";
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
for (int i = 0; i < _v.Length; i++)
|
||||
{
|
||||
sb.AppendLine(_v[i].ToString("0.######", CultureInfo.InvariantCulture));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,287 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DotNetMatrix
|
||||
{
|
||||
|
||||
/// <summary>QR Decomposition.
|
||||
/// For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n
|
||||
/// orthogonal matrix Q and an n-by-n upper triangular matrix R so that
|
||||
/// A = Q*R.
|
||||
///
|
||||
/// The QR decompostion always exists, even if the matrix does not have
|
||||
/// full rank, so the constructor will never fail. The primary use of the
|
||||
/// QR decomposition is in the least squares solution of nonsquare systems
|
||||
/// of simultaneous linear equations. This will fail if IsFullRank()
|
||||
/// returns false.
|
||||
/// </summary>
|
||||
|
||||
[Serializable]
|
||||
public class QRDecomposition : System.Runtime.Serialization.ISerializable
|
||||
{
|
||||
#region Class variables
|
||||
|
||||
/// <summary>Array for internal storage of decomposition.
|
||||
/// @serial internal array storage.
|
||||
/// </summary>
|
||||
private decimal[][] QR;
|
||||
|
||||
/// <summary>Row and column dimensions.
|
||||
/// @serial column dimension.
|
||||
/// @serial row dimension.
|
||||
/// </summary>
|
||||
private int m, n;
|
||||
|
||||
/// <summary>Array for internal storage of diagonal of R.
|
||||
/// @serial diagonal of R.
|
||||
/// </summary>
|
||||
private decimal[] Rdiag;
|
||||
|
||||
#endregion // Class variables
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>QR Decomposition, computed by Householder reflections.</summary>
|
||||
/// <param name="A"> Rectangular matrix
|
||||
/// </param>
|
||||
/// <returns> Structure to access R and the Householder vectors and compute Q.
|
||||
/// </returns>
|
||||
|
||||
public QRDecomposition(GeneralMatrix A)
|
||||
{
|
||||
// Initialize.
|
||||
QR = A.ArrayCopy;
|
||||
m = A.RowDimension;
|
||||
n = A.ColumnDimension;
|
||||
Rdiag = new decimal[n];
|
||||
|
||||
// Main loop.
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
// Compute 2-norm of k-th column without under/overflow.
|
||||
decimal nrm = 0;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
nrm = Maths.Hypot(nrm, QR[i][k]);
|
||||
}
|
||||
|
||||
if (nrm != 0.0m)
|
||||
{
|
||||
// Form k-th Householder vector.
|
||||
if (QR[k][k] < 0)
|
||||
{
|
||||
nrm = - nrm;
|
||||
}
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
QR[i][k] /= nrm;
|
||||
}
|
||||
QR[k][k] += 1.0m;
|
||||
|
||||
// Apply transformation to remaining columns.
|
||||
for (int j = k + 1; j < n; j++)
|
||||
{
|
||||
decimal s = 0.0m;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
s += QR[i][k] * QR[i][j];
|
||||
}
|
||||
s = (- s) / QR[k][k];
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
QR[i][j] += s * QR[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
Rdiag[k] = - nrm;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Constructor
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>Is the matrix full rank?</summary>
|
||||
/// <returns> true if R, and hence A, has full rank.
|
||||
/// </returns>
|
||||
virtual public bool FullRank
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (Rdiag[j] == 0)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Return the Householder vectors</summary>
|
||||
/// <returns> Lower trapezoidal matrix whose columns define the reflections
|
||||
/// </returns>
|
||||
virtual public GeneralMatrix H
|
||||
{
|
||||
get
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] H = X.Array;
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (i >= j)
|
||||
{
|
||||
H[i][j] = QR[i][j];
|
||||
}
|
||||
else
|
||||
{
|
||||
H[i][j] = 0.0m;
|
||||
}
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Return the upper triangular factor</summary>
|
||||
/// <returns> R
|
||||
/// </returns>
|
||||
virtual public GeneralMatrix R
|
||||
{
|
||||
get
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(n, n);
|
||||
decimal[][] R = X.Array;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if (i < j)
|
||||
{
|
||||
R[i][j] = QR[i][j];
|
||||
}
|
||||
else if (i == j)
|
||||
{
|
||||
R[i][j] = Rdiag[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
R[i][j] = 0.0m;
|
||||
}
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Generate and return the (economy-sized) orthogonal factor</summary>
|
||||
/// <returns> Q
|
||||
/// </returns>
|
||||
virtual public GeneralMatrix Q
|
||||
{
|
||||
get
|
||||
{
|
||||
GeneralMatrix X = new GeneralMatrix(m, n);
|
||||
decimal[][] Q = X.Array;
|
||||
for (int k = n - 1; k >= 0; k--)
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
Q[i][k] = 0.0m;
|
||||
}
|
||||
Q[k][k] = 1.0m;
|
||||
for (int j = k; j < n; j++)
|
||||
{
|
||||
if (QR[k][k] != 0)
|
||||
{
|
||||
decimal s = 0.0m;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
s += QR[i][k] * Q[i][j];
|
||||
}
|
||||
s = (- s) / QR[k][k];
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
Q[i][j] += s * QR[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return X;
|
||||
}
|
||||
}
|
||||
#endregion // Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>Least squares solution of A*X = B</summary>
|
||||
/// <param name="B"> A Matrix with as many rows as A and any number of columns.
|
||||
/// </param>
|
||||
/// <returns> X that minimizes the two norm of Q*R*X-B.
|
||||
/// </returns>
|
||||
/// <exception cref="System.ArgumentException"> Matrix row dimensions must agree.
|
||||
/// </exception>
|
||||
/// <exception cref="System.SystemException"> Matrix is rank deficient.
|
||||
/// </exception>
|
||||
|
||||
public virtual GeneralMatrix Solve(GeneralMatrix B)
|
||||
{
|
||||
if (B.RowDimension != m)
|
||||
{
|
||||
throw new System.ArgumentException("GeneralMatrix row dimensions must agree.");
|
||||
}
|
||||
if (!this.FullRank)
|
||||
{
|
||||
throw new System.SystemException("Matrix is rank deficient.");
|
||||
}
|
||||
|
||||
// Copy right hand side
|
||||
int nx = B.ColumnDimension;
|
||||
decimal[][] X = B.ArrayCopy;
|
||||
|
||||
// Compute Y = transpose(Q)*B
|
||||
for (int k = 0; k < n; k++)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
decimal s = 0.0m;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
s += QR[i][k] * X[i][j];
|
||||
}
|
||||
s = (- s) / QR[k][k];
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
X[i][j] += s * QR[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Solve R*X = Y;
|
||||
for (int k = n - 1; k >= 0; k--)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[k][j] /= Rdiag[k];
|
||||
}
|
||||
for (int i = 0; i < k; i++)
|
||||
{
|
||||
for (int j = 0; j < nx; j++)
|
||||
{
|
||||
X[i][j] -= X[k][j] * QR[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (new GeneralMatrix(X, n, nx).GetMatrix(0, n - 1, 0, nx - 1));
|
||||
}
|
||||
|
||||
#endregion // Public Methods
|
||||
|
||||
// A method called when serializing this class.
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,524 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DotNetMatrix
|
||||
{
|
||||
[Serializable]
|
||||
public class SingularValueDecomposition : System.Runtime.Serialization.ISerializable
|
||||
{
|
||||
private decimal[][] U, V;
|
||||
private decimal[] s;
|
||||
private int m, n;
|
||||
|
||||
public SingularValueDecomposition(GeneralMatrix Arg)
|
||||
{
|
||||
m = Arg.RowDimension;
|
||||
n = Arg.ColumnDimension;
|
||||
|
||||
if (m < n)
|
||||
{
|
||||
SingularValueDecomposition svdTrans = new SingularValueDecomposition(Arg.Transpose());
|
||||
s = (decimal[])svdTrans.s.Clone();
|
||||
U = svdTrans.V;
|
||||
V = svdTrans.U;
|
||||
return;
|
||||
}
|
||||
|
||||
decimal[][] A = Arg.ArrayCopy;
|
||||
int nu = System.Math.Min(m, n);
|
||||
s = new decimal[System.Math.Min(m + 1, n)];
|
||||
U = new decimal[m][];
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
U[i] = new decimal[nu];
|
||||
}
|
||||
V = new decimal[n][];
|
||||
for (int i2 = 0; i2 < n; i2++)
|
||||
{
|
||||
V[i2] = new decimal[n];
|
||||
}
|
||||
decimal[] e = new decimal[n];
|
||||
decimal[] work = new decimal[m];
|
||||
bool wantu = true;
|
||||
bool wantv = true;
|
||||
|
||||
int nct = System.Math.Min(m - 1, n);
|
||||
int nrt = System.Math.Max(0, System.Math.Min(n - 2, m));
|
||||
for (int k = 0; k < System.Math.Max(nct, nrt); k++)
|
||||
{
|
||||
if (k < nct)
|
||||
{
|
||||
s[k] = 0;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
s[k] = Maths.Hypot(s[k], A[i][k]);
|
||||
}
|
||||
if (s[k] != 0.0m)
|
||||
{
|
||||
if (A[k][k] < 0.0m)
|
||||
{
|
||||
s[k] = - s[k];
|
||||
}
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
A[i][k] /= s[k];
|
||||
}
|
||||
A[k][k] += 1.0m;
|
||||
}
|
||||
s[k] = - s[k];
|
||||
}
|
||||
for (int j = k + 1; j < n; j++)
|
||||
{
|
||||
if ((k < nct) & (s[k] != 0.0m))
|
||||
{
|
||||
decimal t = 0;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
t += A[i][k] * A[i][j];
|
||||
}
|
||||
t = (- t) / A[k][k];
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
A[i][j] += t * A[i][k];
|
||||
}
|
||||
}
|
||||
e[j] = A[k][j];
|
||||
}
|
||||
if (wantu & (k < nct))
|
||||
{
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
U[i][k] = A[i][k];
|
||||
}
|
||||
}
|
||||
if (k < nrt)
|
||||
{
|
||||
e[k] = 0;
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
e[k] = Maths.Hypot(e[k], e[i]);
|
||||
}
|
||||
if (e[k] != 0.0m)
|
||||
{
|
||||
if (e[k + 1] < 0.0m)
|
||||
{
|
||||
e[k] = - e[k];
|
||||
}
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
e[i] /= e[k];
|
||||
}
|
||||
e[k + 1] += 1.0m;
|
||||
}
|
||||
e[k] = - e[k];
|
||||
if ((k + 1 < m) & (e[k] != 0.0m))
|
||||
{
|
||||
for (int i = k + 1; i < m; i++)
|
||||
{
|
||||
work[i] = 0.0m;
|
||||
}
|
||||
for (int j = k + 1; j < n; j++)
|
||||
{
|
||||
for (int i = k + 1; i < m; i++)
|
||||
{
|
||||
work[i] += e[j] * A[i][j];
|
||||
}
|
||||
}
|
||||
for (int j = k + 1; j < n; j++)
|
||||
{
|
||||
decimal t = (- e[j]) / e[k + 1];
|
||||
for (int i = k + 1; i < m; i++)
|
||||
{
|
||||
A[i][j] += t * work[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wantv)
|
||||
{
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
V[i][k] = e[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int p = System.Math.Min(n, m + 1);
|
||||
if (nct < n)
|
||||
{
|
||||
s[nct] = A[nct][nct];
|
||||
}
|
||||
if (m < p)
|
||||
{
|
||||
s[p - 1] = 0.0m;
|
||||
}
|
||||
if (nrt + 1 < p)
|
||||
{
|
||||
e[nrt] = A[nrt][p - 1];
|
||||
}
|
||||
e[p - 1] = 0.0m;
|
||||
|
||||
if (wantu)
|
||||
{
|
||||
for (int j = nct; j < nu; j++)
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
U[i][j] = 0.0m;
|
||||
}
|
||||
U[j][j] = 1.0m;
|
||||
}
|
||||
for (int k = nct - 1; k >= 0; k--)
|
||||
{
|
||||
if (s[k] != 0.0m)
|
||||
{
|
||||
for (int j = k + 1; j < nu; j++)
|
||||
{
|
||||
decimal t = 0;
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
t += U[i][k] * U[i][j];
|
||||
}
|
||||
t = (- t) / U[k][k];
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
U[i][j] += t * U[i][k];
|
||||
}
|
||||
}
|
||||
for (int i = k; i < m; i++)
|
||||
{
|
||||
U[i][k] = - U[i][k];
|
||||
}
|
||||
U[k][k] = 1.0m + U[k][k];
|
||||
for (int i = 0; i < k - 1; i++)
|
||||
{
|
||||
U[i][k] = 0.0m;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
U[i][k] = 0.0m;
|
||||
}
|
||||
U[k][k] = 1.0m;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wantv)
|
||||
{
|
||||
for (int k = n - 1; k >= 0; k--)
|
||||
{
|
||||
if ((k < nrt) & (e[k] != 0.0m))
|
||||
{
|
||||
for (int j = k + 1; j < nu; j++)
|
||||
{
|
||||
decimal t = 0;
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
t += V[i][k] * V[i][j];
|
||||
}
|
||||
t = (- t) / V[k + 1][k];
|
||||
for (int i = k + 1; i < n; i++)
|
||||
{
|
||||
V[i][j] += t * V[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
V[i][k] = 0.0m;
|
||||
}
|
||||
V[k][k] = 1.0m;
|
||||
}
|
||||
}
|
||||
|
||||
int pp = p - 1;
|
||||
int iter = 0;
|
||||
decimal eps = DecimalMath.Pow(2.0m, -64.0m);
|
||||
while (p > 0 && iter < 150)
|
||||
{
|
||||
int k, kase;
|
||||
for (k = p - 2; k >= - 1; k--)
|
||||
{
|
||||
if (k == - 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (System.Math.Abs(e[k]) <= eps * (System.Math.Abs(s[k]) + System.Math.Abs(s[k + 1])))
|
||||
{
|
||||
e[k] = 0.0m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k == p - 2)
|
||||
{
|
||||
kase = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
int ks;
|
||||
for (ks = p - 1; ks >= k; ks--)
|
||||
{
|
||||
if (ks == k)
|
||||
{
|
||||
break;
|
||||
}
|
||||
decimal t = (ks != p?System.Math.Abs(e[ks]):0.0m) + (ks != k + 1?System.Math.Abs(e[ks - 1]):0.0m);
|
||||
if (System.Math.Abs(s[ks]) <= eps * t)
|
||||
{
|
||||
s[ks] = 0.0m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ks == k)
|
||||
{
|
||||
kase = 3;
|
||||
}
|
||||
else if (ks == p - 1)
|
||||
{
|
||||
kase = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
kase = 2;
|
||||
k = ks;
|
||||
}
|
||||
}
|
||||
k++;
|
||||
|
||||
switch (kase)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
decimal f = e[p - 2];
|
||||
e[p - 2] = 0.0m;
|
||||
for (int j = p - 2; j >= k; j--)
|
||||
{
|
||||
decimal t = Maths.Hypot(s[j], f);
|
||||
decimal cs = s[j] / t;
|
||||
decimal sn = f / t;
|
||||
s[j] = t;
|
||||
if (j != k)
|
||||
{
|
||||
f = (- sn) * e[j - 1];
|
||||
e[j - 1] = cs * e[j - 1];
|
||||
}
|
||||
if (wantv)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
t = cs * V[i][j] + sn * V[i][p - 1];
|
||||
V[i][p - 1] = (- sn) * V[i][j] + cs * V[i][p - 1];
|
||||
V[i][j] = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
decimal f = e[k - 1];
|
||||
e[k - 1] = 0.0m;
|
||||
for (int j = k; j < p; j++)
|
||||
{
|
||||
decimal t = Maths.Hypot(s[j], f);
|
||||
decimal cs = s[j] / t;
|
||||
decimal sn = f / t;
|
||||
s[j] = t;
|
||||
f = (- sn) * e[j];
|
||||
e[j] = cs * e[j];
|
||||
if (wantu)
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
t = cs * U[i][j] + sn * U[i][k - 1];
|
||||
U[i][k - 1] = (- sn) * U[i][j] + cs * U[i][k - 1];
|
||||
U[i][j] = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
decimal scale = System.Math.Max(System.Math.Max(System.Math.Max(System.Math.Max(System.Math.Abs(s[p - 1]), System.Math.Abs(s[p - 2])), System.Math.Abs(e[p - 2])), System.Math.Abs(s[k])), System.Math.Abs(e[k]));
|
||||
decimal sp = s[p - 1] / scale;
|
||||
decimal spm1 = s[p - 2] / scale;
|
||||
decimal epm1 = e[p - 2] / scale;
|
||||
decimal sk = s[k] / scale;
|
||||
decimal ek = e[k] / scale;
|
||||
decimal b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2.0m;
|
||||
decimal c = (sp * epm1) * (sp * epm1);
|
||||
decimal shift = 0.0m;
|
||||
if ((b != 0.0m) | (c != 0.0m))
|
||||
{
|
||||
shift = (decimal)DecimalMath.Sqrt(b * b + c);
|
||||
if (b < 0.0m)
|
||||
{
|
||||
shift = - shift;
|
||||
}
|
||||
shift = c / (b + shift);
|
||||
}
|
||||
decimal f = (sk + sp) * (sk - sp) + shift;
|
||||
decimal g = sk * ek;
|
||||
|
||||
for (int j = k; j < p - 1; j++)
|
||||
{
|
||||
decimal t = Maths.Hypot(f, g);
|
||||
decimal cs = f / t;
|
||||
decimal sn = g / t;
|
||||
if (j != k)
|
||||
{
|
||||
e[j - 1] = t;
|
||||
}
|
||||
f = cs * s[j] + sn * e[j];
|
||||
e[j] = cs * e[j] - sn * s[j];
|
||||
g = sn * s[j + 1];
|
||||
s[j + 1] = cs * s[j + 1];
|
||||
if (wantv)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
t = cs * V[i][j] + sn * V[i][j + 1];
|
||||
V[i][j + 1] = (- sn) * V[i][j] + cs * V[i][j + 1];
|
||||
V[i][j] = t;
|
||||
}
|
||||
}
|
||||
t = Maths.Hypot(f, g);
|
||||
cs = f / t;
|
||||
sn = g / t;
|
||||
s[j] = t;
|
||||
f = cs * e[j] + sn * s[j + 1];
|
||||
s[j + 1] = (- sn) * e[j] + cs * s[j + 1];
|
||||
g = sn * e[j + 1];
|
||||
e[j + 1] = cs * e[j + 1];
|
||||
if (wantu && (j < m - 1))
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
t = cs * U[i][j] + sn * U[i][j + 1];
|
||||
U[i][j + 1] = (- sn) * U[i][j] + cs * U[i][j + 1];
|
||||
U[i][j] = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
e[p - 2] = f;
|
||||
iter = iter + 1;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if (s[k] <= 0.0m)
|
||||
{
|
||||
s[k] = (s[k] < 0.0m?- s[k]:0.0m);
|
||||
if (wantv)
|
||||
{
|
||||
for (int i = 0; i <= pp; i++)
|
||||
{
|
||||
V[i][k] = - V[i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
while (k < pp)
|
||||
{
|
||||
if (s[k] >= s[k + 1])
|
||||
{
|
||||
break;
|
||||
}
|
||||
decimal t = s[k];
|
||||
s[k] = s[k + 1];
|
||||
s[k + 1] = t;
|
||||
if (wantv && (k < n - 1))
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
t = V[i][k + 1]; V[i][k + 1] = V[i][k]; V[i][k] = t;
|
||||
}
|
||||
}
|
||||
if (wantu && (k < m - 1))
|
||||
{
|
||||
for (int i = 0; i < m; i++)
|
||||
{
|
||||
t = U[i][k + 1]; U[i][k + 1] = U[i][k]; U[i][k] = t;
|
||||
}
|
||||
}
|
||||
k++;
|
||||
}
|
||||
iter = 0;
|
||||
p--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual public decimal[] SingularValues
|
||||
{
|
||||
get
|
||||
{
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
virtual public GeneralMatrix S
|
||||
{
|
||||
get
|
||||
{
|
||||
int nu = System.Math.Min(m, n);
|
||||
GeneralMatrix X = new GeneralMatrix(nu, nu);
|
||||
decimal[][] S = X.Array;
|
||||
for (int i = 0; i < nu; i++)
|
||||
{
|
||||
for (int j = 0; j < nu; j++)
|
||||
{
|
||||
S[i][j] = 0.0m;
|
||||
}
|
||||
S[i][i] = this.s[i];
|
||||
}
|
||||
return X;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetU()
|
||||
{
|
||||
return new GeneralMatrix(U, m, System.Math.Min(m, n));
|
||||
}
|
||||
|
||||
public virtual GeneralMatrix GetV()
|
||||
{
|
||||
return new GeneralMatrix(V, n, System.Math.Min(m, n));
|
||||
}
|
||||
|
||||
public virtual decimal Norm2()
|
||||
{
|
||||
return s[0];
|
||||
}
|
||||
|
||||
public virtual decimal Condition()
|
||||
{
|
||||
decimal minS = s[System.Math.Min(m, n) - 1];
|
||||
return minS != 0m ? s[0] / minS : decimal.MaxValue;
|
||||
}
|
||||
|
||||
public virtual int Rank()
|
||||
{
|
||||
decimal eps = (decimal)System.Math.Pow(2.0f, - 52.0f);
|
||||
decimal tol = System.Math.Max(m, n) * s[0] * eps;
|
||||
int r = 0;
|
||||
for (int i = 0; i < s.Length; i++)
|
||||
{
|
||||
if (s[i] > tol)
|
||||
{
|
||||
r++;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"com.unity.collab-proxy": "1.14.18",
|
||||
"com.unity.ide.rider": "1.2.1",
|
||||
"com.unity.ide.visualstudio": "2.0.15",
|
||||
"com.unity.ide.vscode": "1.2.5",
|
||||
"com.unity.test-framework": "1.1.31",
|
||||
"com.unity.textmeshpro": "2.1.4",
|
||||
"com.unity.timeline": "1.2.18",
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.modules.ai": "1.0.0",
|
||||
"com.unity.modules.androidjni": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
"com.unity.modules.assetbundle": "1.0.0",
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.cloth": "1.0.0",
|
||||
"com.unity.modules.director": "1.0.0",
|
||||
"com.unity.modules.imageconversion": "1.0.0",
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0",
|
||||
"com.unity.modules.particlesystem": "1.0.0",
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.physics2d": "1.0.0",
|
||||
"com.unity.modules.screencapture": "1.0.0",
|
||||
"com.unity.modules.terrain": "1.0.0",
|
||||
"com.unity.modules.terrainphysics": "1.0.0",
|
||||
"com.unity.modules.tilemap": "1.0.0",
|
||||
"com.unity.modules.ui": "1.0.0",
|
||||
"com.unity.modules.uielements": "1.0.0",
|
||||
"com.unity.modules.umbra": "1.0.0",
|
||||
"com.unity.modules.unityanalytics": "1.0.0",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestaudio": "1.0.0",
|
||||
"com.unity.modules.unitywebrequesttexture": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestwww": "1.0.0",
|
||||
"com.unity.modules.vehicles": "1.0.0",
|
||||
"com.unity.modules.video": "1.0.0",
|
||||
"com.unity.modules.vr": "1.0.0",
|
||||
"com.unity.modules.wind": "1.0.0",
|
||||
"com.unity.modules.xr": "1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,326 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"com.unity.collab-proxy": {
|
||||
"version": "1.14.18",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ext.nunit": {
|
||||
"version": "1.0.6",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
"version": "1.2.1",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.1"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.visualstudio": {
|
||||
"version": "2.0.15",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.9"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.vscode": {
|
||||
"version": "1.2.5",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.test-framework": {
|
||||
"version": "1.1.31",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.ext.nunit": "1.0.6",
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.textmeshpro": {
|
||||
"version": "2.1.4",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.ugui": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.timeline": {
|
||||
"version": "1.2.18",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.director": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
"com.unity.modules.particlesystem": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ugui": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.ui": "1.0.0",
|
||||
"com.unity.modules.imgui": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.ai": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.androidjni": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.animation": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.assetbundle": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.audio": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.cloth": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.physics": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.director": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.imageconversion": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.imgui": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.jsonserialize": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.particlesystem": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.physics": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.physics2d": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.screencapture": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.imageconversion": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.subsystems": {
|
||||
"version": "1.0.0",
|
||||
"depth": 1,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.terrain": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.terrainphysics": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.terrain": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.tilemap": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.physics2d": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.ui": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.uielements": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.umbra": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.unityanalytics": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.unitywebrequest": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.unitywebrequestassetbundle": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.assetbundle": "1.0.0",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.unitywebrequestaudio": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.modules.audio": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.unitywebrequesttexture": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.modules.imageconversion": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.unitywebrequestwww": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestaudio": "1.0.0",
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.assetbundle": "1.0.0",
|
||||
"com.unity.modules.imageconversion": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.vehicles": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.physics": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.video": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.ui": "1.0.0",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.vr": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.jsonserialize": "1.0.0",
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.xr": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.wind": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.xr": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0",
|
||||
"com.unity.modules.subsystems": "1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!11 &1
|
||||
AudioManager:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Volume: 1
|
||||
Rolloff Scale: 1
|
||||
Doppler Factor: 1
|
||||
Default Speaker Mode: 2
|
||||
m_SampleRate: 0
|
||||
m_DSPBufferSize: 1024
|
||||
m_VirtualVoiceCount: 512
|
||||
m_RealVoiceCount: 32
|
||||
m_SpatializerPlugin:
|
||||
m_AmbisonicDecoderPlugin:
|
||||
m_DisableAudio: 0
|
||||
m_VirtualizeEffects: 1
|
||||
m_RequestedDSPBufferSize: 1024
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!236 &1
|
||||
ClusterInputManager:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Inputs: []
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!55 &1
|
||||
PhysicsManager:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_Gravity: {x: 0, y: -9.81, z: 0}
|
||||
m_DefaultMaterial: {fileID: 0}
|
||||
m_BounceThreshold: 2
|
||||
m_SleepThreshold: 0.005
|
||||
m_DefaultContactOffset: 0.01
|
||||
m_DefaultSolverIterations: 6
|
||||
m_DefaultSolverVelocityIterations: 1
|
||||
m_QueriesHitBackfaces: 0
|
||||
m_QueriesHitTriggers: 1
|
||||
m_EnableAdaptiveForce: 0
|
||||
m_ClothInterCollisionDistance: 0
|
||||
m_ClothInterCollisionStiffness: 0
|
||||
m_ContactsGeneration: 1
|
||||
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_AutoSimulation: 1
|
||||
m_AutoSyncTransforms: 0
|
||||
m_ReuseCollisionCallbacks: 1
|
||||
m_ClothInterCollisionSettingsToggle: 0
|
||||
m_ContactPairsMode: 0
|
||||
m_BroadphaseType: 0
|
||||
m_WorldBounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 250, y: 250, z: 250}
|
||||
m_WorldSubdivisions: 8
|
||||
m_FrictionType: 0
|
||||
m_EnableEnhancedDeterminism: 0
|
||||
m_EnableUnifiedHeightmaps: 1
|
||||
m_DefaultMaxAngluarSpeed: 7
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1045 &1
|
||||
EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/SampleScene.unity
|
||||
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
||||
m_configObjects: {}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!159 &1
|
||||
EditorSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_ExternalVersionControlSupport: Visible Meta Files
|
||||
m_SerializationMode: 2
|
||||
m_LineEndingsForNewScripts: 0
|
||||
m_DefaultBehaviorMode: 0
|
||||
m_PrefabRegularEnvironment: {fileID: 0}
|
||||
m_PrefabUIEnvironment: {fileID: 0}
|
||||
m_SpritePackerMode: 0
|
||||
m_SpritePackerPaddingPower: 1
|
||||
m_EtcTextureCompressorBehavior: 1
|
||||
m_EtcTextureFastCompressor: 1
|
||||
m_EtcTextureNormalCompressor: 2
|
||||
m_EtcTextureBestCompressor: 4
|
||||
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
|
||||
m_ProjectGenerationRootNamespace:
|
||||
m_CollabEditorSettings:
|
||||
inProgressEnabled: 1
|
||||
m_EnableTextureStreamingInEditMode: 1
|
||||
m_EnableTextureStreamingInPlayMode: 1
|
||||
m_AsyncShaderCompilation: 1
|
||||
m_EnterPlayModeOptionsEnabled: 0
|
||||
m_EnterPlayModeOptions: 3
|
||||
m_ShowLightmapResolutionOverlay: 1
|
||||
m_UseLegacyProbeSampleCount: 0
|
||||
m_AssetPipelineMode: 1
|
||||
m_CacheServerMode: 0
|
||||
m_CacheServerEndpoint:
|
||||
m_CacheServerNamespacePrefix: default
|
||||
m_CacheServerEnableDownload: 1
|
||||
m_CacheServerEnableUpload: 1
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!30 &1
|
||||
GraphicsSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_Deferred:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_DeferredReflections:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ScreenSpaceShadows:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LegacyDeferred:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_DepthNormals:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_MotionVectors:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightHalo:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LensFlare:
|
||||
m_Mode: 1
|
||||
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_AlwaysIncludedShaders:
|
||||
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_PreloadedShaders: []
|
||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||
type: 0}
|
||||
m_CustomRenderPipeline: {fileID: 0}
|
||||
m_TransparencySortMode: 0
|
||||
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
|
||||
m_DefaultRenderingPath: 1
|
||||
m_DefaultMobileRenderingPath: 1
|
||||
m_TierSettings:
|
||||
- serializedVersion: 5
|
||||
m_BuildTarget: 14
|
||||
m_Tier: 0
|
||||
m_Settings:
|
||||
standardShaderQuality: 0
|
||||
renderingPath: 1
|
||||
hdrMode: 2
|
||||
realtimeGICPUUsage: 25
|
||||
useReflectionProbeBoxProjection: 0
|
||||
useReflectionProbeBlending: 0
|
||||
useHDR: 0
|
||||
useDetailNormalMap: 0
|
||||
useCascadedShadowMaps: 0
|
||||
prefer32BitShadowMaps: 0
|
||||
enableLPPV: 0
|
||||
useDitherMaskForAlphaBlendedShadows: 0
|
||||
m_Automatic: 1
|
||||
m_LightmapStripping: 0
|
||||
m_FogStripping: 0
|
||||
m_InstancingStripping: 0
|
||||
m_LightmapKeepPlain: 1
|
||||
m_LightmapKeepDirCombined: 1
|
||||
m_LightmapKeepDynamicPlain: 1
|
||||
m_LightmapKeepDynamicDirCombined: 1
|
||||
m_LightmapKeepShadowMask: 1
|
||||
m_LightmapKeepSubtractive: 1
|
||||
m_FogKeepLinear: 1
|
||||
m_FogKeepExp: 1
|
||||
m_FogKeepExp2: 1
|
||||
m_AlbedoSwatchInfos: []
|
||||
m_LightsUseLinearIntensity: 0
|
||||
m_LightsUseColorTemperature: 0
|
||||
m_LogWhenShaderIsCompiled: 0
|
||||
m_AllowEnlightenSupportForUpgradedProject: 0
|
||||
|
|
@ -1,295 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!13 &1
|
||||
InputManager:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Axes:
|
||||
- serializedVersion: 3
|
||||
m_Name: Horizontal
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton: left
|
||||
positiveButton: right
|
||||
altNegativeButton: a
|
||||
altPositiveButton: d
|
||||
gravity: 3
|
||||
dead: 0.001
|
||||
sensitivity: 3
|
||||
snap: 1
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Vertical
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton: down
|
||||
positiveButton: up
|
||||
altNegativeButton: s
|
||||
altPositiveButton: w
|
||||
gravity: 3
|
||||
dead: 0.001
|
||||
sensitivity: 3
|
||||
snap: 1
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire1
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: left ctrl
|
||||
altNegativeButton:
|
||||
altPositiveButton: mouse 0
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire2
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: left alt
|
||||
altNegativeButton:
|
||||
altPositiveButton: mouse 1
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire3
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: left shift
|
||||
altNegativeButton:
|
||||
altPositiveButton: mouse 2
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Jump
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: space
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Mouse X
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton:
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 0
|
||||
dead: 0
|
||||
sensitivity: 0.1
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 1
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Mouse Y
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton:
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 0
|
||||
dead: 0
|
||||
sensitivity: 0.1
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 1
|
||||
axis: 1
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Mouse ScrollWheel
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton:
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 0
|
||||
dead: 0
|
||||
sensitivity: 0.1
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 1
|
||||
axis: 2
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Horizontal
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton:
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 0
|
||||
dead: 0.19
|
||||
sensitivity: 1
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 2
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Vertical
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton:
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 0
|
||||
dead: 0.19
|
||||
sensitivity: 1
|
||||
snap: 0
|
||||
invert: 1
|
||||
type: 2
|
||||
axis: 1
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire1
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: joystick button 0
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire2
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: joystick button 1
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire3
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: joystick button 2
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Jump
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: joystick button 3
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Submit
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: return
|
||||
altNegativeButton:
|
||||
altPositiveButton: joystick button 0
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Submit
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: enter
|
||||
altNegativeButton:
|
||||
altPositiveButton: space
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Cancel
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: escape
|
||||
altNegativeButton:
|
||||
altPositiveButton: joystick button 1
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!126 &1
|
||||
NavMeshProjectSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
areas:
|
||||
- name: Walkable
|
||||
cost: 1
|
||||
- name: Not Walkable
|
||||
cost: 1
|
||||
- name: Jump
|
||||
cost: 2
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
- name:
|
||||
cost: 1
|
||||
m_LastAgentTypeID: -887442657
|
||||
m_Settings:
|
||||
- serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.75
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_SettingNames:
|
||||
- Humanoid
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &1
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 61
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ScopedRegistriesSettingsExpanded: 1
|
||||
oneTimeWarningShown: 0
|
||||
m_Registries:
|
||||
- m_Id: main
|
||||
m_Name:
|
||||
m_Url: https://packages.unity.com
|
||||
m_Scopes: []
|
||||
m_IsDefault: 1
|
||||
m_UserSelectedRegistryName:
|
||||
m_UserAddingNewScopedRegistry: 0
|
||||
m_RegistryInfoDraft:
|
||||
m_ErrorMessage:
|
||||
m_Original:
|
||||
m_Id:
|
||||
m_Name:
|
||||
m_Url:
|
||||
m_Scopes: []
|
||||
m_IsDefault: 0
|
||||
m_Modified: 0
|
||||
m_Name:
|
||||
m_Url:
|
||||
m_Scopes:
|
||||
-
|
||||
m_SelectedScopeIndex: 0
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!19 &1
|
||||
Physics2DSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 4
|
||||
m_Gravity: {x: 0, y: -9.81}
|
||||
m_DefaultMaterial: {fileID: 0}
|
||||
m_VelocityIterations: 8
|
||||
m_PositionIterations: 3
|
||||
m_VelocityThreshold: 1
|
||||
m_MaxLinearCorrection: 0.2
|
||||
m_MaxAngularCorrection: 8
|
||||
m_MaxTranslationSpeed: 100
|
||||
m_MaxRotationSpeed: 360
|
||||
m_BaumgarteScale: 0.2
|
||||
m_BaumgarteTimeOfImpactScale: 0.75
|
||||
m_TimeToSleep: 0.5
|
||||
m_LinearSleepTolerance: 0.01
|
||||
m_AngularSleepTolerance: 2
|
||||
m_DefaultContactOffset: 0.01
|
||||
m_JobOptions:
|
||||
serializedVersion: 2
|
||||
useMultithreading: 0
|
||||
useConsistencySorting: 0
|
||||
m_InterpolationPosesPerJob: 100
|
||||
m_NewContactsPerJob: 30
|
||||
m_CollideContactsPerJob: 100
|
||||
m_ClearFlagsPerJob: 200
|
||||
m_ClearBodyForcesPerJob: 200
|
||||
m_SyncDiscreteFixturesPerJob: 50
|
||||
m_SyncContinuousFixturesPerJob: 50
|
||||
m_FindNearestContactsPerJob: 100
|
||||
m_UpdateTriggerContactsPerJob: 100
|
||||
m_IslandSolverCostThreshold: 100
|
||||
m_IslandSolverBodyCostScale: 1
|
||||
m_IslandSolverContactCostScale: 10
|
||||
m_IslandSolverJointCostScale: 10
|
||||
m_IslandSolverBodiesPerJob: 50
|
||||
m_IslandSolverContactsPerJob: 50
|
||||
m_AutoSimulation: 1
|
||||
m_QueriesHitTriggers: 1
|
||||
m_QueriesStartInColliders: 1
|
||||
m_CallbacksOnDisable: 1
|
||||
m_ReuseCollisionCallbacks: 1
|
||||
m_AutoSyncTransforms: 0
|
||||
m_AlwaysShowColliders: 0
|
||||
m_ShowColliderSleep: 1
|
||||
m_ShowColliderContacts: 0
|
||||
m_ShowColliderAABB: 0
|
||||
m_ContactArrowScale: 0.2
|
||||
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
|
||||
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
|
||||
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
|
||||
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
|
||||
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1386491679 &1
|
||||
PresetManager:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_DefaultPresets: {}
|
||||
|
|
@ -1,672 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!129 &1
|
||||
PlayerSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 20
|
||||
productGUID: d8b1de0afd9b5b14189c97dce69ab4d0
|
||||
AndroidProfiler: 0
|
||||
AndroidFilterTouchesWhenObscured: 0
|
||||
AndroidEnableSustainedPerformanceMode: 0
|
||||
defaultScreenOrientation: 4
|
||||
targetDevice: 2
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
companyName: DefaultCompany
|
||||
productName: Math
|
||||
defaultCursor: {fileID: 0}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
m_SplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_ShowUnitySplashScreen: 1
|
||||
m_ShowUnitySplashLogo: 1
|
||||
m_SplashScreenOverlayOpacity: 1
|
||||
m_SplashScreenAnimation: 0
|
||||
m_SplashScreenLogoStyle: 1
|
||||
m_SplashScreenDrawMode: 0
|
||||
m_SplashScreenBackgroundAnimationZoom: 1
|
||||
m_SplashScreenLogoAnimationZoom: 1
|
||||
m_SplashScreenBackgroundLandscapeAspect: 1
|
||||
m_SplashScreenBackgroundPortraitAspect: 1
|
||||
m_SplashScreenBackgroundLandscapeUvs:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
m_SplashScreenBackgroundPortraitUvs:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
m_SplashScreenLogos: []
|
||||
m_VirtualRealitySplashScreen: {fileID: 0}
|
||||
m_HolographicTrackingLossScreen: {fileID: 0}
|
||||
defaultScreenWidth: 1024
|
||||
defaultScreenHeight: 768
|
||||
defaultScreenWidthWeb: 960
|
||||
defaultScreenHeightWeb: 600
|
||||
m_StereoRenderingPath: 0
|
||||
m_ActiveColorSpace: 0
|
||||
m_MTRendering: 1
|
||||
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
|
||||
iosShowActivityIndicatorOnLoading: -1
|
||||
androidShowActivityIndicatorOnLoading: -1
|
||||
iosUseCustomAppBackgroundBehavior: 0
|
||||
iosAllowHTTPDownload: 1
|
||||
allowedAutorotateToPortrait: 1
|
||||
allowedAutorotateToPortraitUpsideDown: 1
|
||||
allowedAutorotateToLandscapeRight: 1
|
||||
allowedAutorotateToLandscapeLeft: 1
|
||||
useOSAutorotation: 1
|
||||
use32BitDisplayBuffer: 1
|
||||
preserveFramebufferAlpha: 0
|
||||
disableDepthAndStencilBuffers: 0
|
||||
androidStartInFullscreen: 1
|
||||
androidRenderOutsideSafeArea: 1
|
||||
androidUseSwappy: 0
|
||||
androidBlitType: 0
|
||||
defaultIsNativeResolution: 1
|
||||
macRetinaSupport: 1
|
||||
runInBackground: 1
|
||||
captureSingleScreen: 0
|
||||
muteOtherAudioSources: 0
|
||||
Prepare IOS For Recording: 0
|
||||
Force IOS Speakers When Recording: 0
|
||||
deferSystemGesturesMode: 0
|
||||
hideHomeButton: 0
|
||||
submitAnalytics: 1
|
||||
usePlayerLog: 1
|
||||
bakeCollisionMeshes: 0
|
||||
forceSingleInstance: 0
|
||||
useFlipModelSwapchain: 1
|
||||
resizableWindow: 0
|
||||
useMacAppStoreValidation: 0
|
||||
macAppStoreCategory: public.app-category.games
|
||||
gpuSkinning: 1
|
||||
xboxPIXTextureCapture: 0
|
||||
xboxEnableAvatar: 0
|
||||
xboxEnableKinect: 0
|
||||
xboxEnableKinectAutoTracking: 0
|
||||
xboxEnableFitness: 0
|
||||
visibleInBackground: 1
|
||||
allowFullscreenSwitch: 1
|
||||
fullscreenMode: 1
|
||||
xboxSpeechDB: 0
|
||||
xboxEnableHeadOrientation: 0
|
||||
xboxEnableGuest: 0
|
||||
xboxEnablePIXSampling: 0
|
||||
metalFramebufferOnly: 0
|
||||
xboxOneResolution: 0
|
||||
xboxOneSResolution: 0
|
||||
xboxOneXResolution: 3
|
||||
xboxOneMonoLoggingLevel: 0
|
||||
xboxOneLoggingLevel: 1
|
||||
xboxOneDisableEsram: 0
|
||||
xboxOneEnableTypeOptimization: 0
|
||||
xboxOnePresentImmediateThreshold: 0
|
||||
switchQueueCommandMemory: 0
|
||||
switchQueueControlMemory: 16384
|
||||
switchQueueComputeMemory: 262144
|
||||
switchNVNShaderPoolsGranularity: 33554432
|
||||
switchNVNDefaultPoolsGranularity: 16777216
|
||||
switchNVNOtherPoolsGranularity: 16777216
|
||||
switchNVNMaxPublicTextureIDCount: 0
|
||||
switchNVNMaxPublicSamplerIDCount: 0
|
||||
stadiaPresentMode: 0
|
||||
stadiaTargetFramerate: 0
|
||||
vulkanNumSwapchainBuffers: 3
|
||||
vulkanEnableSetSRGBWrite: 0
|
||||
vulkanEnableLateAcquireNextImage: 0
|
||||
m_SupportedAspectRatios:
|
||||
4:3: 1
|
||||
5:4: 1
|
||||
16:10: 1
|
||||
16:9: 1
|
||||
Others: 1
|
||||
bundleVersion: 0.1
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
xboxOneDisableKinectGpuReservation: 1
|
||||
xboxOneEnable7thCore: 1
|
||||
vrSettings:
|
||||
cardboard:
|
||||
depthFormat: 0
|
||||
enableTransitionView: 0
|
||||
daydream:
|
||||
depthFormat: 0
|
||||
useSustainedPerformanceMode: 0
|
||||
enableVideoLayer: 0
|
||||
useProtectedVideoMemory: 0
|
||||
minimumSupportedHeadTracking: 0
|
||||
maximumSupportedHeadTracking: 1
|
||||
hololens:
|
||||
depthFormat: 1
|
||||
depthBufferSharingEnabled: 1
|
||||
lumin:
|
||||
depthFormat: 0
|
||||
frameTiming: 2
|
||||
enableGLCache: 0
|
||||
glCacheMaxBlobSize: 524288
|
||||
glCacheMaxFileSize: 8388608
|
||||
oculus:
|
||||
sharedDepthBuffer: 1
|
||||
dashSupport: 1
|
||||
lowOverheadMode: 0
|
||||
protectedContext: 0
|
||||
v2Signing: 1
|
||||
enable360StereoCapture: 0
|
||||
isWsaHolographicRemotingEnabled: 0
|
||||
enableFrameTimingStats: 0
|
||||
useHDRDisplay: 0
|
||||
D3DHDRBitDepth: 0
|
||||
m_ColorGamuts: 00000000
|
||||
targetPixelDensity: 30
|
||||
resolutionScalingMode: 0
|
||||
androidSupportedAspectRatio: 1
|
||||
androidMaxAspectRatio: 2.1
|
||||
applicationIdentifier:
|
||||
Standalone: com.TAN.Math
|
||||
buildNumber: {}
|
||||
AndroidBundleVersionCode: 1
|
||||
AndroidMinSdkVersion: 19
|
||||
AndroidTargetSdkVersion: 0
|
||||
AndroidPreferredInstallLocation: 1
|
||||
aotOptions:
|
||||
stripEngineCode: 1
|
||||
iPhoneStrippingLevel: 0
|
||||
iPhoneScriptCallOptimization: 0
|
||||
ForceInternetPermission: 0
|
||||
ForceSDCardPermission: 0
|
||||
CreateWallpaper: 0
|
||||
APKExpansionFiles: 0
|
||||
keepLoadedShadersAlive: 0
|
||||
StripUnusedMeshComponents: 1
|
||||
VertexChannelCompressionMask: 4054
|
||||
iPhoneSdkVersion: 988
|
||||
iOSTargetOSVersionString: 10.0
|
||||
tvOSSdkVersion: 0
|
||||
tvOSRequireExtendedGameController: 0
|
||||
tvOSTargetOSVersionString: 10.0
|
||||
uIPrerenderedIcon: 0
|
||||
uIRequiresPersistentWiFi: 0
|
||||
uIRequiresFullScreen: 1
|
||||
uIStatusBarHidden: 1
|
||||
uIExitOnSuspend: 0
|
||||
uIStatusBarStyle: 0
|
||||
appleTVSplashScreen: {fileID: 0}
|
||||
appleTVSplashScreen2x: {fileID: 0}
|
||||
tvOSSmallIconLayers: []
|
||||
tvOSSmallIconLayers2x: []
|
||||
tvOSLargeIconLayers: []
|
||||
tvOSLargeIconLayers2x: []
|
||||
tvOSTopShelfImageLayers: []
|
||||
tvOSTopShelfImageLayers2x: []
|
||||
tvOSTopShelfImageWideLayers: []
|
||||
tvOSTopShelfImageWideLayers2x: []
|
||||
iOSLaunchScreenType: 0
|
||||
iOSLaunchScreenPortrait: {fileID: 0}
|
||||
iOSLaunchScreenLandscape: {fileID: 0}
|
||||
iOSLaunchScreenBackgroundColor:
|
||||
serializedVersion: 2
|
||||
rgba: 0
|
||||
iOSLaunchScreenFillPct: 100
|
||||
iOSLaunchScreenSize: 100
|
||||
iOSLaunchScreenCustomXibPath:
|
||||
iOSLaunchScreeniPadType: 0
|
||||
iOSLaunchScreeniPadImage: {fileID: 0}
|
||||
iOSLaunchScreeniPadBackgroundColor:
|
||||
serializedVersion: 2
|
||||
rgba: 0
|
||||
iOSLaunchScreeniPadFillPct: 100
|
||||
iOSLaunchScreeniPadSize: 100
|
||||
iOSLaunchScreeniPadCustomXibPath:
|
||||
iOSUseLaunchScreenStoryboard: 0
|
||||
iOSLaunchScreenCustomStoryboardPath:
|
||||
iOSDeviceRequirements: []
|
||||
iOSURLSchemes: []
|
||||
iOSBackgroundModes: 0
|
||||
iOSMetalForceHardShadows: 0
|
||||
metalEditorSupport: 1
|
||||
metalAPIValidation: 1
|
||||
iOSRenderExtraFrameOnPause: 0
|
||||
iosCopyPluginsCodeInsteadOfSymlink: 0
|
||||
appleDeveloperTeamID:
|
||||
iOSManualSigningProvisioningProfileID:
|
||||
tvOSManualSigningProvisioningProfileID:
|
||||
iOSManualSigningProvisioningProfileType: 0
|
||||
tvOSManualSigningProvisioningProfileType: 0
|
||||
appleEnableAutomaticSigning: 0
|
||||
iOSRequireARKit: 0
|
||||
iOSAutomaticallyDetectAndAddCapabilities: 1
|
||||
appleEnableProMotion: 0
|
||||
clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
|
||||
templatePackageId: com.unity.template.3d@4.2.8
|
||||
templateDefaultScene: Assets/Scenes/SampleScene.unity
|
||||
AndroidTargetArchitectures: 1
|
||||
AndroidSplashScreenScale: 0
|
||||
androidSplashScreen: {fileID: 0}
|
||||
AndroidKeystoreName:
|
||||
AndroidKeyaliasName:
|
||||
AndroidBuildApkPerCpuArchitecture: 0
|
||||
AndroidTVCompatibility: 0
|
||||
AndroidIsGame: 1
|
||||
AndroidEnableTango: 0
|
||||
androidEnableBanner: 1
|
||||
androidUseLowAccuracyLocation: 0
|
||||
androidUseCustomKeystore: 0
|
||||
m_AndroidBanners:
|
||||
- width: 320
|
||||
height: 180
|
||||
banner: {fileID: 0}
|
||||
androidGamepadSupportLevel: 0
|
||||
AndroidValidateAppBundleSize: 1
|
||||
AndroidAppBundleSizeToValidate: 150
|
||||
m_BuildTargetIcons: []
|
||||
m_BuildTargetPlatformIcons: []
|
||||
m_BuildTargetBatching:
|
||||
- m_BuildTarget: Standalone
|
||||
m_StaticBatching: 1
|
||||
m_DynamicBatching: 0
|
||||
- m_BuildTarget: tvOS
|
||||
m_StaticBatching: 1
|
||||
m_DynamicBatching: 0
|
||||
- m_BuildTarget: Android
|
||||
m_StaticBatching: 1
|
||||
m_DynamicBatching: 0
|
||||
- m_BuildTarget: iPhone
|
||||
m_StaticBatching: 1
|
||||
m_DynamicBatching: 0
|
||||
- m_BuildTarget: WebGL
|
||||
m_StaticBatching: 0
|
||||
m_DynamicBatching: 0
|
||||
m_BuildTargetGraphicsJobs:
|
||||
- m_BuildTarget: MacStandaloneSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: Switch
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: MetroSupport
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: AppleTVSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: BJMSupport
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: LinuxStandaloneSupport
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: PS4Player
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: iOSSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: WindowsStandaloneSupport
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: XboxOnePlayer
|
||||
m_GraphicsJobs: 1
|
||||
- m_BuildTarget: LuminSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: AndroidPlayer
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: WebGLSupport
|
||||
m_GraphicsJobs: 0
|
||||
m_BuildTargetGraphicsJobMode:
|
||||
- m_BuildTarget: PS4Player
|
||||
m_GraphicsJobMode: 0
|
||||
- m_BuildTarget: XboxOnePlayer
|
||||
m_GraphicsJobMode: 0
|
||||
m_BuildTargetGraphicsAPIs:
|
||||
- m_BuildTarget: AndroidPlayer
|
||||
m_APIs: 150000000b000000
|
||||
m_Automatic: 0
|
||||
- m_BuildTarget: iOSSupport
|
||||
m_APIs: 10000000
|
||||
m_Automatic: 1
|
||||
- m_BuildTarget: AppleTVSupport
|
||||
m_APIs: 10000000
|
||||
m_Automatic: 0
|
||||
- m_BuildTarget: WebGLSupport
|
||||
m_APIs: 0b000000
|
||||
m_Automatic: 1
|
||||
m_BuildTargetVRSettings:
|
||||
- m_BuildTarget: Standalone
|
||||
m_Enabled: 0
|
||||
m_Devices:
|
||||
- Oculus
|
||||
- OpenVR
|
||||
openGLRequireES31: 0
|
||||
openGLRequireES31AEP: 0
|
||||
openGLRequireES32: 0
|
||||
m_TemplateCustomTags: {}
|
||||
mobileMTRendering:
|
||||
Android: 1
|
||||
iPhone: 1
|
||||
tvOS: 1
|
||||
m_BuildTargetGroupLightmapEncodingQuality: []
|
||||
m_BuildTargetGroupLightmapSettings: []
|
||||
playModeTestRunnerEnabled: 0
|
||||
runPlayModeTestAsEditModeTest: 0
|
||||
actionOnDotNetUnhandledException: 1
|
||||
enableInternalProfiler: 0
|
||||
logObjCUncaughtExceptions: 1
|
||||
enableCrashReportAPI: 0
|
||||
cameraUsageDescription:
|
||||
locationUsageDescription:
|
||||
microphoneUsageDescription:
|
||||
switchNetLibKey:
|
||||
switchSocketMemoryPoolSize: 6144
|
||||
switchSocketAllocatorPoolSize: 128
|
||||
switchSocketConcurrencyLimit: 14
|
||||
switchScreenResolutionBehavior: 2
|
||||
switchUseCPUProfiler: 0
|
||||
switchApplicationID: 0x01004b9000490000
|
||||
switchNSODependencies:
|
||||
switchTitleNames_0:
|
||||
switchTitleNames_1:
|
||||
switchTitleNames_2:
|
||||
switchTitleNames_3:
|
||||
switchTitleNames_4:
|
||||
switchTitleNames_5:
|
||||
switchTitleNames_6:
|
||||
switchTitleNames_7:
|
||||
switchTitleNames_8:
|
||||
switchTitleNames_9:
|
||||
switchTitleNames_10:
|
||||
switchTitleNames_11:
|
||||
switchTitleNames_12:
|
||||
switchTitleNames_13:
|
||||
switchTitleNames_14:
|
||||
switchPublisherNames_0:
|
||||
switchPublisherNames_1:
|
||||
switchPublisherNames_2:
|
||||
switchPublisherNames_3:
|
||||
switchPublisherNames_4:
|
||||
switchPublisherNames_5:
|
||||
switchPublisherNames_6:
|
||||
switchPublisherNames_7:
|
||||
switchPublisherNames_8:
|
||||
switchPublisherNames_9:
|
||||
switchPublisherNames_10:
|
||||
switchPublisherNames_11:
|
||||
switchPublisherNames_12:
|
||||
switchPublisherNames_13:
|
||||
switchPublisherNames_14:
|
||||
switchIcons_0: {fileID: 0}
|
||||
switchIcons_1: {fileID: 0}
|
||||
switchIcons_2: {fileID: 0}
|
||||
switchIcons_3: {fileID: 0}
|
||||
switchIcons_4: {fileID: 0}
|
||||
switchIcons_5: {fileID: 0}
|
||||
switchIcons_6: {fileID: 0}
|
||||
switchIcons_7: {fileID: 0}
|
||||
switchIcons_8: {fileID: 0}
|
||||
switchIcons_9: {fileID: 0}
|
||||
switchIcons_10: {fileID: 0}
|
||||
switchIcons_11: {fileID: 0}
|
||||
switchIcons_12: {fileID: 0}
|
||||
switchIcons_13: {fileID: 0}
|
||||
switchIcons_14: {fileID: 0}
|
||||
switchSmallIcons_0: {fileID: 0}
|
||||
switchSmallIcons_1: {fileID: 0}
|
||||
switchSmallIcons_2: {fileID: 0}
|
||||
switchSmallIcons_3: {fileID: 0}
|
||||
switchSmallIcons_4: {fileID: 0}
|
||||
switchSmallIcons_5: {fileID: 0}
|
||||
switchSmallIcons_6: {fileID: 0}
|
||||
switchSmallIcons_7: {fileID: 0}
|
||||
switchSmallIcons_8: {fileID: 0}
|
||||
switchSmallIcons_9: {fileID: 0}
|
||||
switchSmallIcons_10: {fileID: 0}
|
||||
switchSmallIcons_11: {fileID: 0}
|
||||
switchSmallIcons_12: {fileID: 0}
|
||||
switchSmallIcons_13: {fileID: 0}
|
||||
switchSmallIcons_14: {fileID: 0}
|
||||
switchManualHTML:
|
||||
switchAccessibleURLs:
|
||||
switchLegalInformation:
|
||||
switchMainThreadStackSize: 1048576
|
||||
switchPresenceGroupId:
|
||||
switchLogoHandling: 0
|
||||
switchReleaseVersion: 0
|
||||
switchDisplayVersion: 1.0.0
|
||||
switchStartupUserAccount: 0
|
||||
switchTouchScreenUsage: 0
|
||||
switchSupportedLanguagesMask: 0
|
||||
switchLogoType: 0
|
||||
switchApplicationErrorCodeCategory:
|
||||
switchUserAccountSaveDataSize: 0
|
||||
switchUserAccountSaveDataJournalSize: 0
|
||||
switchApplicationAttribute: 0
|
||||
switchCardSpecSize: -1
|
||||
switchCardSpecClock: -1
|
||||
switchRatingsMask: 0
|
||||
switchRatingsInt_0: 0
|
||||
switchRatingsInt_1: 0
|
||||
switchRatingsInt_2: 0
|
||||
switchRatingsInt_3: 0
|
||||
switchRatingsInt_4: 0
|
||||
switchRatingsInt_5: 0
|
||||
switchRatingsInt_6: 0
|
||||
switchRatingsInt_7: 0
|
||||
switchRatingsInt_8: 0
|
||||
switchRatingsInt_9: 0
|
||||
switchRatingsInt_10: 0
|
||||
switchRatingsInt_11: 0
|
||||
switchRatingsInt_12: 0
|
||||
switchLocalCommunicationIds_0:
|
||||
switchLocalCommunicationIds_1:
|
||||
switchLocalCommunicationIds_2:
|
||||
switchLocalCommunicationIds_3:
|
||||
switchLocalCommunicationIds_4:
|
||||
switchLocalCommunicationIds_5:
|
||||
switchLocalCommunicationIds_6:
|
||||
switchLocalCommunicationIds_7:
|
||||
switchParentalControl: 0
|
||||
switchAllowsScreenshot: 1
|
||||
switchAllowsVideoCapturing: 1
|
||||
switchAllowsRuntimeAddOnContentInstall: 0
|
||||
switchDataLossConfirmation: 0
|
||||
switchUserAccountLockEnabled: 0
|
||||
switchSystemResourceMemory: 16777216
|
||||
switchSupportedNpadStyles: 22
|
||||
switchNativeFsCacheSize: 32
|
||||
switchIsHoldTypeHorizontal: 0
|
||||
switchSupportedNpadCount: 8
|
||||
switchSocketConfigEnabled: 0
|
||||
switchTcpInitialSendBufferSize: 32
|
||||
switchTcpInitialReceiveBufferSize: 64
|
||||
switchTcpAutoSendBufferSizeMax: 256
|
||||
switchTcpAutoReceiveBufferSizeMax: 256
|
||||
switchUdpSendBufferSize: 9
|
||||
switchUdpReceiveBufferSize: 42
|
||||
switchSocketBufferEfficiency: 4
|
||||
switchSocketInitializeEnabled: 1
|
||||
switchNetworkInterfaceManagerInitializeEnabled: 1
|
||||
switchPlayerConnectionEnabled: 1
|
||||
ps4NPAgeRating: 12
|
||||
ps4NPTitleSecret:
|
||||
ps4NPTrophyPackPath:
|
||||
ps4ParentalLevel: 11
|
||||
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
|
||||
ps4Category: 0
|
||||
ps4MasterVersion: 01.00
|
||||
ps4AppVersion: 01.00
|
||||
ps4AppType: 0
|
||||
ps4ParamSfxPath:
|
||||
ps4VideoOutPixelFormat: 0
|
||||
ps4VideoOutInitialWidth: 1920
|
||||
ps4VideoOutBaseModeInitialWidth: 1920
|
||||
ps4VideoOutReprojectionRate: 60
|
||||
ps4PronunciationXMLPath:
|
||||
ps4PronunciationSIGPath:
|
||||
ps4BackgroundImagePath:
|
||||
ps4StartupImagePath:
|
||||
ps4StartupImagesFolder:
|
||||
ps4IconImagesFolder:
|
||||
ps4SaveDataImagePath:
|
||||
ps4SdkOverride:
|
||||
ps4BGMPath:
|
||||
ps4ShareFilePath:
|
||||
ps4ShareOverlayImagePath:
|
||||
ps4PrivacyGuardImagePath:
|
||||
ps4ExtraSceSysFile:
|
||||
ps4NPtitleDatPath:
|
||||
ps4RemotePlayKeyAssignment: -1
|
||||
ps4RemotePlayKeyMappingDir:
|
||||
ps4PlayTogetherPlayerCount: 0
|
||||
ps4EnterButtonAssignment: 1
|
||||
ps4ApplicationParam1: 0
|
||||
ps4ApplicationParam2: 0
|
||||
ps4ApplicationParam3: 0
|
||||
ps4ApplicationParam4: 0
|
||||
ps4DownloadDataSize: 0
|
||||
ps4GarlicHeapSize: 2048
|
||||
ps4ProGarlicHeapSize: 2560
|
||||
playerPrefsMaxSize: 32768
|
||||
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
|
||||
ps4pnSessions: 1
|
||||
ps4pnPresence: 1
|
||||
ps4pnFriends: 1
|
||||
ps4pnGameCustomData: 1
|
||||
playerPrefsSupport: 0
|
||||
enableApplicationExit: 0
|
||||
resetTempFolder: 1
|
||||
restrictedAudioUsageRights: 0
|
||||
ps4UseResolutionFallback: 0
|
||||
ps4ReprojectionSupport: 0
|
||||
ps4UseAudio3dBackend: 0
|
||||
ps4UseLowGarlicFragmentationMode: 1
|
||||
ps4SocialScreenEnabled: 0
|
||||
ps4ScriptOptimizationLevel: 0
|
||||
ps4Audio3dVirtualSpeakerCount: 14
|
||||
ps4attribCpuUsage: 0
|
||||
ps4PatchPkgPath:
|
||||
ps4PatchLatestPkgPath:
|
||||
ps4PatchChangeinfoPath:
|
||||
ps4PatchDayOne: 0
|
||||
ps4attribUserManagement: 0
|
||||
ps4attribMoveSupport: 0
|
||||
ps4attrib3DSupport: 0
|
||||
ps4attribShareSupport: 0
|
||||
ps4attribExclusiveVR: 0
|
||||
ps4disableAutoHideSplash: 0
|
||||
ps4videoRecordingFeaturesUsed: 0
|
||||
ps4contentSearchFeaturesUsed: 0
|
||||
ps4CompatibilityPS5: 0
|
||||
ps4GPU800MHz: 1
|
||||
ps4attribEyeToEyeDistanceSettingVR: 0
|
||||
ps4IncludedModules: []
|
||||
ps4attribVROutputEnabled: 0
|
||||
monoEnv:
|
||||
splashScreenBackgroundSourceLandscape: {fileID: 0}
|
||||
splashScreenBackgroundSourcePortrait: {fileID: 0}
|
||||
blurSplashScreenBackground: 1
|
||||
spritePackerPolicy:
|
||||
webGLMemorySize: 16
|
||||
webGLExceptionSupport: 1
|
||||
webGLNameFilesAsHashes: 0
|
||||
webGLDataCaching: 1
|
||||
webGLDebugSymbols: 0
|
||||
webGLEmscriptenArgs:
|
||||
webGLModulesDirectory:
|
||||
webGLTemplate: APPLICATION:Default
|
||||
webGLAnalyzeBuildSize: 0
|
||||
webGLUseEmbeddedResources: 0
|
||||
webGLCompressionFormat: 1
|
||||
webGLLinkerTarget: 1
|
||||
webGLThreadsSupport: 0
|
||||
webGLWasmStreaming: 0
|
||||
scriptingDefineSymbols: {}
|
||||
platformArchitecture: {}
|
||||
scriptingBackend: {}
|
||||
il2cppCompilerConfiguration: {}
|
||||
managedStrippingLevel: {}
|
||||
incrementalIl2cppBuild: {}
|
||||
allowUnsafeCode: 0
|
||||
additionalIl2CppArgs:
|
||||
scriptingRuntimeVersion: 1
|
||||
gcIncremental: 0
|
||||
assemblyVersionValidation: 1
|
||||
gcWBarrierValidation: 0
|
||||
apiCompatibilityLevelPerPlatform: {}
|
||||
m_RenderingPath: 1
|
||||
m_MobileRenderingPath: 1
|
||||
metroPackageName: Template_3D
|
||||
metroPackageVersion:
|
||||
metroCertificatePath:
|
||||
metroCertificatePassword:
|
||||
metroCertificateSubject:
|
||||
metroCertificateIssuer:
|
||||
metroCertificateNotAfter: 0000000000000000
|
||||
metroApplicationDescription: Template_3D
|
||||
wsaImages: {}
|
||||
metroTileShortName: Math
|
||||
metroTileShowName: 0
|
||||
metroMediumTileShowName: 0
|
||||
metroLargeTileShowName: 0
|
||||
metroWideTileShowName: 0
|
||||
metroSupportStreamingInstall: 0
|
||||
metroLastRequiredScene: 0
|
||||
metroDefaultTileSize: 1
|
||||
metroTileForegroundText: 2
|
||||
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
|
||||
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,
|
||||
a: 1}
|
||||
metroSplashScreenUseBackgroundColor: 0
|
||||
platformCapabilities: {}
|
||||
metroTargetDeviceFamilies: {}
|
||||
metroFTAName:
|
||||
metroFTAFileTypes: []
|
||||
metroProtocolName:
|
||||
XboxOneProductId:
|
||||
XboxOneUpdateKey:
|
||||
XboxOneSandboxId:
|
||||
XboxOneContentId:
|
||||
XboxOneTitleId:
|
||||
XboxOneSCId:
|
||||
XboxOneGameOsOverridePath:
|
||||
XboxOnePackagingOverridePath:
|
||||
XboxOneAppManifestOverridePath:
|
||||
XboxOneVersion: 1.0.0.0
|
||||
XboxOnePackageEncryption: 0
|
||||
XboxOnePackageUpdateGranularity: 2
|
||||
XboxOneDescription:
|
||||
XboxOneLanguage:
|
||||
- enus
|
||||
XboxOneCapability: []
|
||||
XboxOneGameRating: {}
|
||||
XboxOneIsContentPackage: 0
|
||||
XboxOneEnhancedXboxCompatibilityMode: 0
|
||||
XboxOneEnableGPUVariability: 1
|
||||
XboxOneSockets: {}
|
||||
XboxOneSplashScreen: {fileID: 0}
|
||||
XboxOneAllowedProductIds: []
|
||||
XboxOnePersistentLocalStorageSize: 0
|
||||
XboxOneXTitleMemory: 8
|
||||
XboxOneOverrideIdentityName:
|
||||
XboxOneOverrideIdentityPublisher:
|
||||
vrEditorSettings:
|
||||
daydream:
|
||||
daydreamIconForeground: {fileID: 0}
|
||||
daydreamIconBackground: {fileID: 0}
|
||||
cloudServicesEnabled:
|
||||
UNet: 1
|
||||
luminIcon:
|
||||
m_Name:
|
||||
m_ModelFolderPath:
|
||||
m_PortalFolderPath:
|
||||
luminCert:
|
||||
m_CertPath:
|
||||
m_SignPackage: 1
|
||||
luminIsChannelApp: 0
|
||||
luminVersion:
|
||||
m_VersionCode: 1
|
||||
m_VersionName:
|
||||
apiCompatibilityLevel: 6
|
||||
cloudProjectId:
|
||||
framebufferDepthMemorylessMode: 0
|
||||
projectName:
|
||||
organizationId:
|
||||
cloudEnabled: 0
|
||||
enableNativePlatformBackendsForNewInputSystem: 0
|
||||
disableOldInputManagerSupport: 0
|
||||
legacyClampBlendShapeWeights: 0
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
m_EditorVersion: 2019.4.41f1
|
||||
m_EditorVersionWithRevision: 2019.4.41f1 (fb553f8fdd6c)
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!47 &1
|
||||
QualitySettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 5
|
||||
m_CurrentQuality: 5
|
||||
m_QualitySettings:
|
||||
- serializedVersion: 2
|
||||
name: Very Low
|
||||
pixelLightCount: 0
|
||||
shadows: 0
|
||||
shadowResolution: 0
|
||||
shadowProjection: 1
|
||||
shadowCascades: 1
|
||||
shadowDistance: 15
|
||||
shadowNearPlaneOffset: 3
|
||||
shadowCascade2Split: 0.33333334
|
||||
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
|
||||
shadowmaskMode: 0
|
||||
blendWeights: 1
|
||||
textureQuality: 1
|
||||
anisotropicTextures: 0
|
||||
antiAliasing: 0
|
||||
softParticles: 0
|
||||
softVegetation: 0
|
||||
realtimeReflectionProbes: 0
|
||||
billboardsFaceCameraPosition: 0
|
||||
vSyncCount: 0
|
||||
lodBias: 0.3
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 4
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 16
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
name: Low
|
||||
pixelLightCount: 0
|
||||
shadows: 0
|
||||
shadowResolution: 0
|
||||
shadowProjection: 1
|
||||
shadowCascades: 1
|
||||
shadowDistance: 20
|
||||
shadowNearPlaneOffset: 3
|
||||
shadowCascade2Split: 0.33333334
|
||||
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
|
||||
shadowmaskMode: 0
|
||||
blendWeights: 2
|
||||
textureQuality: 0
|
||||
anisotropicTextures: 0
|
||||
antiAliasing: 0
|
||||
softParticles: 0
|
||||
softVegetation: 0
|
||||
realtimeReflectionProbes: 0
|
||||
billboardsFaceCameraPosition: 0
|
||||
vSyncCount: 0
|
||||
lodBias: 0.4
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 16
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 16
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
name: Medium
|
||||
pixelLightCount: 1
|
||||
shadows: 1
|
||||
shadowResolution: 0
|
||||
shadowProjection: 1
|
||||
shadowCascades: 1
|
||||
shadowDistance: 20
|
||||
shadowNearPlaneOffset: 3
|
||||
shadowCascade2Split: 0.33333334
|
||||
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
|
||||
shadowmaskMode: 0
|
||||
blendWeights: 2
|
||||
textureQuality: 0
|
||||
anisotropicTextures: 1
|
||||
antiAliasing: 0
|
||||
softParticles: 0
|
||||
softVegetation: 0
|
||||
realtimeReflectionProbes: 0
|
||||
billboardsFaceCameraPosition: 0
|
||||
vSyncCount: 1
|
||||
lodBias: 0.7
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 64
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 16
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
name: High
|
||||
pixelLightCount: 2
|
||||
shadows: 2
|
||||
shadowResolution: 1
|
||||
shadowProjection: 1
|
||||
shadowCascades: 2
|
||||
shadowDistance: 40
|
||||
shadowNearPlaneOffset: 3
|
||||
shadowCascade2Split: 0.33333334
|
||||
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
|
||||
shadowmaskMode: 1
|
||||
blendWeights: 2
|
||||
textureQuality: 0
|
||||
anisotropicTextures: 1
|
||||
antiAliasing: 0
|
||||
softParticles: 0
|
||||
softVegetation: 1
|
||||
realtimeReflectionProbes: 1
|
||||
billboardsFaceCameraPosition: 1
|
||||
vSyncCount: 1
|
||||
lodBias: 1
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 256
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 16
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
name: Very High
|
||||
pixelLightCount: 3
|
||||
shadows: 2
|
||||
shadowResolution: 2
|
||||
shadowProjection: 1
|
||||
shadowCascades: 2
|
||||
shadowDistance: 70
|
||||
shadowNearPlaneOffset: 3
|
||||
shadowCascade2Split: 0.33333334
|
||||
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
|
||||
shadowmaskMode: 1
|
||||
blendWeights: 4
|
||||
textureQuality: 0
|
||||
anisotropicTextures: 2
|
||||
antiAliasing: 2
|
||||
softParticles: 1
|
||||
softVegetation: 1
|
||||
realtimeReflectionProbes: 1
|
||||
billboardsFaceCameraPosition: 1
|
||||
vSyncCount: 1
|
||||
lodBias: 1.5
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 1024
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 16
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
name: Ultra
|
||||
pixelLightCount: 4
|
||||
shadows: 2
|
||||
shadowResolution: 2
|
||||
shadowProjection: 1
|
||||
shadowCascades: 4
|
||||
shadowDistance: 150
|
||||
shadowNearPlaneOffset: 3
|
||||
shadowCascade2Split: 0.33333334
|
||||
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
|
||||
shadowmaskMode: 1
|
||||
blendWeights: 4
|
||||
textureQuality: 0
|
||||
anisotropicTextures: 2
|
||||
antiAliasing: 2
|
||||
softParticles: 1
|
||||
softVegetation: 1
|
||||
realtimeReflectionProbes: 1
|
||||
billboardsFaceCameraPosition: 1
|
||||
vSyncCount: 1
|
||||
lodBias: 2
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 4096
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 16
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
m_PerPlatformDefaultQuality:
|
||||
Android: 2
|
||||
Lumin: 5
|
||||
Nintendo 3DS: 5
|
||||
Nintendo Switch: 5
|
||||
PS4: 5
|
||||
PSP2: 2
|
||||
Stadia: 5
|
||||
Standalone: 5
|
||||
WebGL: 3
|
||||
Windows Store Apps: 5
|
||||
XboxOne: 5
|
||||
iPhone: 2
|
||||
tvOS: 2
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 2
|
||||
tags: []
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
- Ignore Raycast
|
||||
-
|
||||
- Water
|
||||
- UI
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
m_SortingLayers:
|
||||
- name: Default
|
||||
uniqueID: 0
|
||||
locked: 0
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!5 &1
|
||||
TimeManager:
|
||||
m_ObjectHideFlags: 0
|
||||
Fixed Timestep: 0.02
|
||||
Maximum Allowed Timestep: 0.33333334
|
||||
m_TimeScale: 1
|
||||
Maximum Particle Timestep: 0.03
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!310 &1
|
||||
UnityConnectSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 1
|
||||
m_Enabled: 0
|
||||
m_TestMode: 0
|
||||
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
|
||||
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
|
||||
m_ConfigUrl: https://config.uca.cloud.unity3d.com
|
||||
m_TestInitMode: 0
|
||||
CrashReportingSettings:
|
||||
m_EventUrl: https://perf-events.cloud.unity3d.com
|
||||
m_Enabled: 0
|
||||
m_LogBufferSize: 10
|
||||
m_CaptureEditorExceptions: 1
|
||||
UnityPurchasingSettings:
|
||||
m_Enabled: 0
|
||||
m_TestMode: 0
|
||||
UnityAnalyticsSettings:
|
||||
m_Enabled: 0
|
||||
m_TestMode: 0
|
||||
m_InitializeOnStartup: 1
|
||||
UnityAdsSettings:
|
||||
m_Enabled: 0
|
||||
m_InitializeOnStartup: 1
|
||||
m_TestMode: 0
|
||||
m_IosGameId:
|
||||
m_AndroidGameId:
|
||||
m_GameIds: {}
|
||||
m_GameId:
|
||||
PerformanceReportingSettings:
|
||||
m_Enabled: 0
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!937362698 &1
|
||||
VFXManager:
|
||||
m_ObjectHideFlags: 0
|
||||
m_IndirectShader: {fileID: 0}
|
||||
m_CopyBufferShader: {fileID: 0}
|
||||
m_SortShader: {fileID: 0}
|
||||
m_StripUpdateShader: {fileID: 0}
|
||||
m_RenderPipeSettingsPath:
|
||||
m_FixedTimeStep: 0.016666668
|
||||
m_MaxDeltaTime: 0.05
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"m_SettingKeys": [
|
||||
"VR Device Disabled",
|
||||
"VR Device User Alert"
|
||||
],
|
||||
"m_SettingValues": [
|
||||
"False",
|
||||
"False"
|
||||
]
|
||||
}
|
||||
44
README.md
44
README.md
|
|
@ -1,4 +1,4 @@
|
|||
# 📐 ttCalculator v2.1.0
|
||||
# 📐 ttCalculator v2.2.0
|
||||
|
||||
[](https://github.com/LilDosto/ttCalculator/releases)
|
||||
[](LICENSE)
|
||||
|
|
@ -15,13 +15,38 @@ Tüm matematiksel çekirdek, 1.169 otomatik testten oluşan kapsamlı doğrulama
|
|||
|
||||
Uygulamanın hazır derlenmiş Windows sürümünü (`ttCalculator.exe`) hemen çalıştırmak için:
|
||||
|
||||
1. **[Releases](https://github.com/LilDosto/ttCalculator/releases/tag/v2.1.0)** sayfasına gidin.
|
||||
2. **`ttCalculator.exe`** (veya `ttCalculator-v2.1.0-win-x64.zip`) dosyasını indirin.
|
||||
1. **[Releases](https://github.com/LilDosto/ttCalculator/releases/tag/v2.2.0)** sayfasına gidin.
|
||||
2. **`ttCalculator.exe`** (veya `ttCalculator-v2.2.0-win-x64.zip`) dosyasını indirin.
|
||||
3. Çift tıklayarak doğrudan çalıştırın — ek bağımlılık gerektirmez!
|
||||
|
||||
---
|
||||
|
||||
## ✨ v2.1.0 Temel Özellikleri & Modüller
|
||||
## 📁 Proje Mimarisi
|
||||
|
||||
Proje, modern ve temiz bir .NET 8 çözüm mimarisine sahiptir:
|
||||
|
||||
```
|
||||
ttCalculator/
|
||||
├── ttCalculator.sln # Ana Visual Studio / .NET Çözüm Dosyası
|
||||
├── src/
|
||||
│ └── ttCalculator/ # Masaüstü Uygulaması (WinForms / .NET 8)
|
||||
│ ├── Controls/ # 9 Temel Arayüz Modülü ve Kullanıcı Kontrolleri
|
||||
│ ├── Core/ # 128-bit Matematik, Matris ve Nümerik Yöntem Çekirdeği
|
||||
│ ├── MainForm.cs # Ana Pencere ve Akışkan Gezinme Yönetimi
|
||||
│ ├── ThemeHelper.cs # Koyu Tema ve Çift Tamponlama (Double Buffering)
|
||||
│ ├── Program.cs # Tekil Örnek (Single-Instance Mutex) Giriş Noktası
|
||||
│ └── ttCalculator.csproj # Uygulama Proje Yapılandırması
|
||||
├── tests/
|
||||
│ └── ttCalculator.Tests/ # Otomatik Doğrulama Testleri (1.169 Test)
|
||||
│ └── ttCalculator.Tests.csproj
|
||||
├── Release/ # Taşınabilir Tek Dosya Dağıtımları
|
||||
├── LICENSE # MIT Lisansı
|
||||
└── README.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✨ Temel Özellikler & Modüller
|
||||
|
||||
Uygulama modern koyu tema (Dark Theme) arayüzü ile 9 ana modülden oluşmaktadır:
|
||||
|
||||
|
|
@ -98,11 +123,14 @@ Uygulama modern koyu tema (Dark Theme) arayüzü ile 9 ana modülden oluşmaktad
|
|||
git clone https://github.com/LilDosto/ttCalculator.git
|
||||
cd ttCalculator
|
||||
|
||||
# Projeyi derleyin
|
||||
dotnet build MathApp/MathApp/MathApp.csproj -c Release
|
||||
# Çözümü derleyin
|
||||
dotnet build ttCalculator.sln -c Release
|
||||
|
||||
# Tek parça .exe olarak yayımlayın
|
||||
dotnet publish MathApp/MathApp/MathApp.csproj -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o "Release"
|
||||
# Doğrulama testlerini çalıştırın
|
||||
dotnet run --project tests/ttCalculator.Tests/ttCalculator.Tests.csproj
|
||||
|
||||
# Tek dosya .exe olarak yayımlayın
|
||||
dotnet publish src/ttCalculator/ttCalculator.csproj -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o "Release"
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue