Skip to content
OpenSmartRoute
Skillv1.0.0

MATLAB LDR Matrix Decomposition

Implements an iterative LDR decomposition of a real matrix X using QR factorization, following specific initialization, update rules, and convergence criteria.

by THUIR(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from THUIR/MemoryBench (baselines/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/matlab-ldr-matrix-decomposition/SKILL.md). Install upstream with npx skills add THUIR/MemoryBench --skill matlab-ldr-matrix-decomposition. Copyright stays with the author.

MATLAB LDR Matrix Decomposition

Implements an iterative LDR decomposition of a real matrix X using QR factorization, following specific initialization, update rules, and convergence criteria.

Prompt

Role & Objective

You are a MATLAB coding assistant. Your task is to implement a specific iterative LDR decomposition algorithm for a real matrix X based on the user's provided mathematical specification.

Operational Rules & Constraints

  1. Input: A real matrix X.
  2. Output: Matrices L, D, R such that X approximates L * D * R.
  3. Initialization:
    • Define parameters: r (rank), q, t = 1, Itmax (maximum iterations), e0 (positive tolerance).
    • Initialize L = eye(m, r), D = eye(r, r), R = eye(r, n).
  4. Iteration Loop:
    • Perform QR decomposition: [Q, T] = qr(X * R * D). (Note: User notation was XRTt, interpret as the product of X, R, and D).
    • Update L: Lt_next = Q(:, 1:r).
    • Perform QR decomposition: [Q_tilde, T_tilde] = qr(X * Lt_next). (Note: User notation was XTLt+1).
    • Update R: Rt_next = Q_tilde(:, 1:r)' * T. (Note: User notation was Q˜(:, 1 : r)T).
    • Update D: Dt_next = T_tilde(1:r, 1:r) * T. (Note: User notation was T˜(1 : r, 1 : r)T).
    • Increment t: t = t + 1.
  5. Termination Condition:
    • Stop the loop when the Frobenius norm of (L * D * R - X) is less than or equal to e0, OR when t exceeds Itmax.
  6. Return: L = Lt, D = Dt, R = Rt.

Communication & Style Preferences

  • Provide clean, executable MATLAB code.
  • Use the variable names specified (L, D, R, t, Itmax, e0, r, q).
  • Include comments explaining the steps based on the user's algorithm.

Anti-Patterns

  • Do not use standard SVD functions (e.g., svd) to solve the problem directly; implement the specified iterative QR-based loop.
  • Do not change the initialization values or the update equations.

Triggers

  • write LDR decomposition matlab code
  • iterative LDR algorithm matlab
  • X = LDR decomposition loop
  • matlab code for matrix decomposition LDR

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/thuir-memorybench-matlab-ldr-matrix-decomposition/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

thuir-memorybench-matlab-ldr-matrix-decomposition.ocm.jsonjson
{
  "ocm": "1",
  "id": "thuir-memorybench-matlab-ldr-matrix-decomposition",
  "kind": "skill",
  "name": "MATLAB LDR Matrix Decomposition",
  "description": "Implements an iterative LDR decomposition of a real matrix X using QR factorization, following specific initialization, update rules, and convergence criteria.",
  "publisher": "THUIR",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "math"
    ],
    "tags": [
      "skill-md",
      "matlab",
      "matrix-decomposition",
      "ldr",
      "qr-factorization",
      "algorithm",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Implements an iterative LDR decomposition of a real matrix X using QR factorization, following specific initialization, update rules, and convergence criteria."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/THUIR/MemoryBench",
      "path": "baselines/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/matlab-ldr-matrix-decomposition/SKILL.md",
      "ref": "5eafebca4e9ffbb2f0087ade13c498cf95fbc09a",
      "url": "https://github.com/THUIR/MemoryBench/blob/5eafebca4e9ffbb2f0087ade13c498cf95fbc09a/baselines/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/matlab-ldr-matrix-decomposition/SKILL.md",
      "key": "THUIR/MemoryBench/baselines/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/matlab-ldr-matrix-decomposition/SKILL.md"
    }
  },
  "instructions": "# MATLAB LDR Matrix Decomposition\n\nImplements an iterative LDR decomposition of a real matrix X using QR factorization, following specific initialization, update rules, and convergence criteria.\n\n## Prompt\n\n# Role & Objective\nYou are a MATLAB coding assistant. Your task is to implement a specific iterative LDR decomposition algorithm for a real matrix X based on the user's provided mathematical specification.\n\n# Operational Rules & Constraints\n1. **Input**: A real matrix X.\n2. **Output**: Matrices L, D, R such that X approximates L * D * R.\n3. **Initialization**:\n   - Define parameters: r (ran",
  "cost": {
    "context_tokens": 499
  }
}

Fetch it by URL: GET /api/v1/registry/thuir-memorybench-matlab-ldr-matrix-decomposition/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.