Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 794307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:17:37+00:00 2026-05-14T22:17:37+00:00

Given a N-dimensional vector of small integers is there any simple way to map

  • 0

Given a N-dimensional vector of small integers is there any simple way to map it with one-to-one correspondence to a large integer number?

Say, we have N=3 vector space. Can we represent a vector X=[(int16)x1,(int16)x2,(int16)x3] using an integer (int48)y? The obvious answer is “Yes, we can”. But the question is: “What is the fastest way to do this and its inverse operation?”

Will this new 1-dimensional space possess some very special useful properties?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:17:37+00:00Added an answer on May 14, 2026 at 10:17 pm

    Just to make this concrete, if you have a 3-dimensional vector of 8-bit numbers, like this:

    uint8_t vector[3] = { 1, 2, 3 };
    

    then you can join them into a single (24-bit number) like so:

    uint32_t all = (vector[0] << 16) | (vector[1] << 8) | vector[2];
    

    This number would, if printed using this statement:

    printf("the vector was packed into %06x", (unsigned int) all);
    

    produce the output

    the vector was packed into 010203
    

    The reverse operation would look like this:

    uint8_t v2[3];
    
    v2[0] = (all >> 16) & 0xff;
    v2[1] = (all >> 8) & 0xff;
    v2[2] = all & 0xff;
    

    Of course this all depends on the size of the individual numbers in the vector and the length of the vector together not exceeding the size of an available integer type, otherwise you can’t represent the “packed” vector as a single number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given an n-dimensional matrix of values: what is the most efficient way of retrieving
There is a points given in two dimensional plane and I want to count
Given a vector of the counter-diagonals of a matrix in matlab, is there an
Problem Statement is : Given 2 Dimensional array, print output for example If 4
Given a UIImage of any dimension, I wish to generate a square icon sized
I would like to populate an 2 dimensional array, from a vector. I think
I am trying to make a 5 dimensional vector and I can’t seem to
Sampling uniformly at random from an n-dimensional unit simplex is the fancy way to
The dot product of two n-dimensional vectors u=[u1,u2,...un] and v=[v1,v2,...,vn] is is given by
I have a simple question: given p points (non-collinear) in R^p i find the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.