Skip to Main Content
InterSystems Ideas
We love hearing from our users. Tell us what you want to see next and upvote ideas from the community.
* Bugs and troubleshooting should as usual go through InterSystems support.
Status Needs review
Categories InterSystems IRIS
Created by Robert Cemper
Created on Apr 29, 2024

Expand Vector Arithmetics

Enhance Vectore calculation beyond VECTOR_COSINE(),TO_VECTOR(),VECTOR_DOT_PRODUCT()

I especially miss these functions:

  • FROM_VECTOR to get the content of $ZV into a variable (JSON ?)

  • ADD_VECTOR() for transformation. For INT and DOUBLE

  • DiFF_VECTOR() for Vector distance For INT and DOUBLE

  • ADMIN RESPONSE
    Apr 30, 2024

    Thank you for submitting the idea. The status has been changed to "Needs review".

    Stay tuned!

  • Robert Cemper
    Reply
    |
    May 4, 2024

    I wrote an overview of what is available actually.
    Using VECTORs in ObjectScript
    Almost everything is there already. It just needs to be wrapped into SQL Procedures.
    Not a big deal for an experienced COS developer

  • Robert Cemper
    Reply
    |
    Apr 30, 2024

    As my replies and comments show it is doable but incredibly uncomfortable
    Some simpler approaches as SQL Methods will be attrative

  • Robert Cemper
    Reply
    |
    Apr 29, 2024
    ADD_VECTOR:
    >zw vec1,vec2
    vec1={"type":"integer", "count":3, "length":3, "vector":[100,300,678]} ; <VECTOR>
    vec2={"type":"integer", "count":3, "length":3, "vector":[123,345,678]} ; <VECTOR>
    >set vplus=$vop("v+",vec1,vec2)
    >zw vplus
    vplus={"type":"integer", "count":3, "length":3, "vector":[223,645,1356]} ; <VECTOR>

    DIFF_VECTOR:set vdiff=$vop("v-",vec1,vec2)

    USER>zw vdiff

    vdiff={"type":"integer", "count":3, "length":3, "vector":[-23,-45,0]} ; <VECTOR>



    1 reply
  • Robert Cemper
    Reply
    |
    Apr 29, 2024

    digging across documentation I detected that this is all available in COS!
    and even well described in the documentation.

    $vector()
    $vectorop (ObjectScript)

    1 reply