BLI: Add support for non-square matrix multiplication. #115783
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Blocks
#114772 GPv3: Fill texture coordinates data storage
blender/blender
Reference: blender/blender#115783
Loading…
Reference in New Issue
No description provided.
Delete Branch "casey-bianco-davis/blender:GPv3-non-square-matrix-multiplication"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds support for multiplying non-square non-equal matrices.
@blender-bot build
Only blender organization members with write access can start builds. See documentation for details.
@blender-bot build
WIP: BLI: Add support for non-square matrix multiplication.to BLI: Add support for non-square matrix multiplication.I think I fixed the build error, but I am have difficulties get the test to build on my local computer. so someone activating blender-bot would be helpful.
@blender-bot build
Added some feedback
@ -384,1 +382,4 @@
/** Multiply two compatible matrices using matrix multiplication. */
template<int OtherNumRow>
MatBase<T, OtherNumRow, NumRow> operator*(const MatBase<T, OtherNumRow, NumCol> &b) const
This won't work, because the template specialization is the same as
MatBase<T, NumRow, NumRow> operator*(const MatBase<T, NumRow, NumCol> &b) const
.Sorry I am new to c++ and don't know what is the correct way to write this. Help would be appreciated :)
Not sure as well, maybe @JacquesLucke or @fclem can help?
I think you just have to replace the equal size matrices case by the non-equal size. Non-equal size should give the same result as equal size if called with same size matrices.
@ -458,6 +473,13 @@ struct alignas(Alignment) MatBase : public vec_struct_base<VecBase<T, NumRow>, N
return result;
}
static MatBase diagonal(const VecBase<T, min_dim> value)
Seems like this is unrelated?
see 116077
@ -371,6 +371,30 @@ TEST(math_matrix, MatrixMultiply)
}
}
TEST(math_matrix, RectangularMatrixMultiply)
Merge that to the
MatrixMultiply
.@ -374,0 +375,4 @@
{
{
const float3x4 matrix_a = transpose(float4x3(float3(1.0, 0.0, 1.0),
I would avoid relying on
transpose
in the multiply test.@ -374,0 +376,4 @@
{
const float3x4 matrix_a = transpose(float4x3(float3(1.0, 0.0, 1.0),
float3(2.0, 1.0, 1.0),
Do not use a matrix so simple. Use a different number for each cell like the 4x4 test.
Use https://matrix.reshish.com/multCalculation.php to set the expected value.
@ -374,0 +387,4 @@
float3(6.0f, 5.0f, 3.0f),
float3(11.0f, 9.0f, 6.0f)));
const float3x4 result = matrix_a * matrix_b;
I would add
float2x3 * float3x4
andfloat2x3 * float3x2
to make sure the resulting matrix type is effectivelyfloat2x4
andfloat2x2
.BLI: Add support for non-square matrix multiplication.to WIP: BLI: Add support for non-square matrix multiplication.WIP: BLI: Add support for non-square matrix multiplication.to BLI: Add support for non-square matrix multiplication.@blender-bot build